May 04, 2012

Detect Scroll Beyond


<script type="text/javascript">

        function hookScroll(target, percent, callback) {
            $(target).bind('scroll', function () {
                if ((($(target).scrollTop() /
                                   $(target).innerHeight()) * 100)
                                   >= percent) {
                    callback();
                }
            });
        }

        function callback() {
            //alert("Scroll");
       
        }

        hookScroll(document, 40, callback);
    </script>

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home