• Can I Make that Bubble only shows up when scrolling down?

    Please help

    • This topic was modified 2 years, 8 months ago by nimavi.
Viewing 1 replies (of 1 total)
  • Henry N

    (@henrynguyen259)

    Try this:

    <script type="text/javascript">    
            (function($) { 
                $(document).ready(function(event){
                    
                    $(document.body).on('woofc_cart_loaded', function(){
                        // Hide Bubble when page load
                        var woofc_bubble = $('.woofc-count');
                        
                        if(woofc_bubble.length) {
                            
                            woofc_bubble.addClass('woofc-count-hide');
    
                            var lastScroll = 0;
    
                            $(window).scroll(function(){
                                var nowScroll = $(this).scrollTop();
                                if (nowScroll > lastScroll){
                                    // Show Bubble when scrolling down
                                    woofc_bubble.removeClass('woofc-count-hide');
                                }
    
                                lastScroll = nowScroll;
                            });
                        }
                    });
                });
            })(jQuery);
        </script>
Viewing 1 replies (of 1 total)
  • The topic ‘Bubble only shows up when scrolling’ is closed to new replies.