HOME / BLOG

How to change scroller color according to background ?

Change scroller color according to background //decode and use this code according to ur demand function handleDarkSectionColors() { var section = $(‘.clb__dark_section, .clb__light_section’); var sectionClass; if (section.length) { var scrollTop = $(‘.clb-scroll-top’); var socialLinks = $(‘.clb-social’); var fixedSearch = $(‘.search-global.fixed .ion’); var self_window; $(window).on(‘scroll’, function(){ self_window = $(this); activeSection(self_window); }); function activeSection(self_window) { var st […]

How to scroll to top on click and change color after scrolling some length by jquery?

Scroll to top on click and change color after scrolling some length by jquery //jquery used $(window).scroll(function(){ var scrollval = $(window).scrollTop(); if(scrollval > 652) { $(“.scroller”).css(“color”,”white”); } if(scrollval < 652){ $(“.scroller”).css(“color”,””); } }); $(“.scroller”).click(function(){ $(window).scrollTop(0); }); //html used <div class=”scroller”> Tap to scroll up </div> <div class=”jtset”> jtest </div> //css used div .jtset{ background:blue; height:500px; […]