dimanche 10 juillet 2016

How to trigger an action based on scroll events when using fullpage.js smart one page plugin for wp

i'm using wordpress and the X-Thme also visual composer with the smart one extension, the problem of why i'm here is because i need to make the logo image on my navbar to fadein when scrolling past the slider section the code that i'm using actually works so far but not on the page build with the smart one extension from the visual composer backend panel. I just simply can't trigger any action, can be the behavior of the scrolling on this page the reason of this? this is the code that i'm using

`(function ($) { $(document).ready(function(){

// hide .navbar first
$(".x-brand img").hide();

// fade in .navbar
$(function () {
    $(window).scroll(function () {
        // set distance user needs to scroll before we fadeIn navbar
        if ($(this).scrollTop() > 2000) {
            $('.x-brand img').fadeIn();
        } else {
            $('.x-brand img').fadeOut();
        }
    });


});

}); }(jQuery));`

Aucun commentaire:

Enregistrer un commentaire