Make div scroll until it reaches top of page?

goodbyegoodbye

New Member
I am trying to use the following example in wordpress - I need a div that holds an advert to start, say, 300px down the page, then scroll up witht he page until it reaches the top, then stay there if the user continues to scroll down. The example should explain this:http://jsfiddle.net/jPxEY/here it is in an html file that should work, everything seems there, but it will not work: http://www.altesc.net/exmp.htmlIn fact, if you look tot he right at the "Similar Questions" box and scroll down, it's exactly what i'm after.I am pretty sure I've done everything correctly, but the javascript doesn't seem to work. If i copy everything from jquery and just add it directly to the header, and not in a separate js file, it works, it's only when i call jquery like this:\[code\]<script src="http://code.jquery.com/jquery-1.7.1.js" type="text/javascript">\[/code\]it fails to kick in.Any ideas as to what is wrong?Added my header to help:\[code\]<script type='text/javascript' src='http://www.altesc.net/wp-includes/js/jquery/jquery.js?ver=1.8.3'></script><script type="text/javascript">//<![CDATA[$(window).load(function(){$(document).scroll(function() {var useFixedSidebar = $(document).scrollTop() > 330;$('.adscrollleft').toggleClass('fixedSidebar', useFixedSidebar);});});//]]> </script>\[/code\]
 
Back
Top