JQuery scroll does not work after PrettyPhoto has been triggered
<p>Hello I hope someone can help me, I am using the jquery scroll function to jump to different sections in the page with anchors in a smooth way. I do it based on the scroll position, here is the code I develop to do that which works great:</p>

<pre><code>// variables for the scroller effect
    var scrollTop;
    var timer;

    // we must be loading step 1, so make the first step the current one.
    $("#controlBtn li:eq(0)").addClass("current");
    $("#controlBtn li:eq(0) h1").show("fast");

    $('#controlBtn li a').click(function () {
        triggerCorrespondingItem();
    });

    $(window).scroll(function () {
        // store scrolling value
        scrollTop = $(window).scrollTop();

        console.log("scroll position: " + scrollTop); // testing

        // set timerfor when window scroller stops
        clearTimeout(timer);
        timer = setTimeout(function () {
            triggerCorrespondingItem();
        }, 250);
    });

    function triggerCorrespondingItem() {
        if (scrollTop &gt;= 0 &amp;&amp; scrollTop &lt; 392) {
            // for step 1 "start"
            elem = $('#controlBtn li:eq(0)');
            if (!elem.hasClass("current")) {
                removingCurrentInstance();
                $("#controlBtn li:eq(0) h1").show("fast");
                $('#controlBtn li:eq(0)').addClass('current');
            }
        } else if (scrollTop &gt; 725 &amp;&amp; scrollTop &lt; 1140) {
            // for step 2 "need"
            elem = $('#controlBtn li:eq(1)');
            if (!elem.hasClass("current")) {
                removingCurrentInstance();
                $("#controlBtn li:eq(1) h1").show("fast");
                $('#controlBtn li:eq(1)').addClass('current');
            }
        } else if (scrollTop &gt; 1654 &amp;&amp; scrollTop &lt; 2075) {
            // for step 3 "contact"
            elem = $('#controlBtn li:eq(2)');
            if (!elem.hasClass("current")) {
                removingCurrentInstance();
                $("#controlBtn li:eq(2) h1").show("fast");
                $('#controlBtn li:eq(2)').addClass('current');
            }
        } else if (scrollTop &gt; 2500 &amp;&amp; scrollTop &lt; 2949) {
            // for step 4 "pick-up"
            elem = $('#controlBtn li:eq(3)');
            if (!elem.hasClass("current")) {
                removingCurrentInstance();
                $("#controlBtn li:eq(3) h1").show("fast");
                $('#controlBtn li:eq(3)').addClass('current');
            }
        } else if (scrollTop &gt; 3420 &amp;&amp; scrollTop &lt; 3870) {
            // for step 5 "pre-production"
            elem = $('#controlBtn li:eq(4)');
            if (!elem.hasClass("current")) {
                removingCurrentInstance();
                $("#controlBtn li:eq(4) h1").show("fast");
                $('#controlBtn li:eq(4)').addClass('current');
            }
        } else if (scrollTop &gt; 4275 &amp;&amp; scrollTop &lt; 4745) {
            // for step 6 "sacanning"
            elem = $('#controlBtn li:eq(5)');
            if (!elem.hasClass("current")) {
                removingCurrentInstance();
                $("#controlBtn li:eq(5) h1").show("fast");
                $('#controlBtn li:eq(5)').addClass('current');
            }
        } else if (scrollTop &gt; 5245 &amp;&amp; scrollTop &lt; 5660) {
            // for step 7 "delivery"
            elem = $('#controlBtn li:eq(6)');
            if (!elem.hasClass("current")) {
                removingCurrentInstance();
                $("#controlBtn li:eq(6) h1").show("fast");
                $('#controlBtn li:eq(6)').addClass('current');
            }
        } else if (scrollTop &gt; 6092) {
            // for step 8 "resolution"
            elem = $('#controlBtn li:eq(7)');
            if (!elem.hasClass("current")) {
                removingCurrentInstance();
                $("#controlBtn li:eq(7) h1").show("fast");
                $('#controlBtn li:eq(7)').addClass('current');
            }
        } else {
            removingCurrentInstance();
        }
    }

    function removingCurrentInstance() {
        // remove "current" class and hide current label while scrolling
        $('#controlBtn li').removeClass('current');
        $("#controlBtn li h1").hide("fast");
    }
</code></pre>

<p>Then I have a link that open a video light box with prettyphoto, so after I open the video lightbox the scroll function above does not work anymore.</p>
