Ok so I have a small problem that I can't seem to figure out. I am using a JScroll plugin I found that uses JQuery to make elements scroll down the page as a user scrolls down the page. I have used it for the navigation menu on my website. The problem is that on most pages it scrolls fine, but on some it scrolls to a certain point and then stops.
I can't find anything in the code that jumps out at me as to why it won't scroll the same? It just stops? Any idea?
Here is the js for the plugin:
And I include both jquery 1.5.2 and jscroll at the top of the page inside the head tags:
Thanks so much for your help! I'm sure I'm just missing something silly
Brendon
I can't find anything in the code that jumps out at me as to why it won't scroll the same? It just stops? Any idea?
Here is the js for the plugin:
Code:
(function($){$.fn.jScroll=function(d){var e=$.extend({},$.fn.jScroll.defaults,d);return this.each(function(){var a=$(this);var b=$(window);var c=new location(a);b.scroll(function(){a.stop().animate(c.getMargin(b),e.speed)})});function location(c){this.min=c.offset().top;this.max=c.parent().height()-c.outerHeight();this.originalMargin=parseInt(c.css("margin-top"));this.getMargin=function(a){var b=this.originalMargin;if(a.scrollTop()>=this.min)b=b+e.top+a.scrollTop()-this.min;if(b>this.max)b=this.max;return({"marginTop":b+'px'})}}};$.fn.jScroll.defaults={speed:"slow",top:10}})(jQuery);
And I include both jquery 1.5.2 and jscroll at the top of the page inside the head tags:
Code:
<script type="text/javascript" src="/includes/styles/js/jquery.js"></script>
<script type="text/javascript" src="/includes/styles/js/jquery.jscroll-1.0.min.js"></script>
<script type="text/javascript">
$(function() {
$(".scroll").jScroll({top : 30});
});
</script>
Thanks so much for your help! I'm sure I'm just missing something silly
Brendon
Last edited: