Betty_S Posted January 23, 2007 Share Posted January 23, 2007 Hi!I want to move a div whenever the user scrolls the browse elsewhere.How is that possible? Link to comment Share on other sites More sharing options...
jesh Posted January 23, 2007 Share Posted January 23, 2007 I found this post. It might help. http://www.dynamicdrive.com/forums/archive...php/t-6966.htmlThe gist of the code is as follows: <html><head><script type="text/javascript">function hanldeScroll(e){ e = (e) ? e : window.event; var delta = (e.wheelDelta) ? e.wheelDelta : e.detail; alert(delta);}if(document.attachEvent) document.attachEvent("onmousewheel", hanldeScroll);else window.addEventListener("DOMMouseScroll", hanldeScroll, false);</script></head><body>...</body></html> When I ran a test in the Tryit Editor, IE would alert 120 when I scrolled one direction and -120 when I'd scroll in the other direction. Firefox would alert 3 and -3. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now