I am trying to produce a sticky side menu for a page on my website ( http://familyfostering.ismywebsite.co.uk/fosterwith.php ) and using a tutorial from this site http://www.wduffy.co.uk/blog/keep-el...-using-jquery/
It has worked perfectly, however I need it to stop scrolling at a certain point so you can get to the bottom page, you will see what I mean on the page. Any suggestions?
JS
Code:$().ready(function() { var $scrollingDiv = $("#sticker"); $(window).scroll(function(){ $scrollingDiv .stop() .animate({"marginTop": ($(window).scrollTop() + 0) + "px"}, "fast" ); }); });
CSS
Code:#sticker { width:210px; height:auto; display:block; float:left; overflow:hidden; }
HTML
HTML Code:<head> <script type="text/javascript" src="jquery-1.3.2.min.js"></script> <script type='text/javascript' src='js/js.js'></script> </head> <div id="main"> <div id="sticker"> <ul id="sidemenu"> <li><a href="#">Page</a></li> <li><a href="#">Page</a></li> <li><a href="#">Page</a></li> <li><a href="#">Page</a></li> <li><a href="#">Page</a></li> </ul> </div> <!--Content--> </div> <!--wanting the sticky div to stop at this point-->



Reply With Quote


Bookmarks