Little Goat Posted April 3, 2006 Share Posted April 3, 2006 hi everyone,I was wondering if anyone knew how to make it so that your user can drag the page to scroll like in acrobat reader. I thought it would probably be done with javascript.if not or if it's not possible at all will someone please tell me?thanks, LG Link to comment Share on other sites More sharing options...
Little Goat Posted April 4, 2006 Author Share Posted April 4, 2006 is it impossible?anybody know? Link to comment Share on other sites More sharing options...
scott100 Posted April 4, 2006 Share Posted April 4, 2006 No it's possible, i have it working with IE just not FF.be patient Link to comment Share on other sites More sharing options...
scott100 Posted April 4, 2006 Share Posted April 4, 2006 hi everyone,I was wondering if anyone knew how to make it so that your user can drag the page to scroll like in acrobat reader. I thought it would probably be done with javascript.if not or if it's not possible at all will someone please tell me?thanks, LG<{POST_SNAPBACK}> here it is, allows you to click and drag the page<head><script>function down(){ document.getElementById(2).value="yes"; document.body.style.cursor="move";}function up(){ document.getElementById(2).value="no"; document.body.style.cursor="default";}function move(event){ if (document.getElementById(2).value=='yes') { scroll(event.clientX,event.clientY); }}</script></head><body onmousemove="move(event)" onmousedown="down()" onmouseup="up()"><input type="hidden" id="2" /><div style="background-color:red;height:500px;width:30px;border:1px dashed black"></div><div style="background-color:red;height:30px;width:1500px;border:1px dashed black"></div><div style="background-color:red;height:500px;width:30px;border:1px dashed black"></div></body> Link to comment Share on other sites More sharing options...
aspnetguy Posted April 4, 2006 Share Posted April 4, 2006 sweet job scott.You rock at JS.I am starting ot get more comfortable with JS and can do most things I need but this is amazing. Link to comment Share on other sites More sharing options...
Little Goat Posted April 4, 2006 Author Share Posted April 4, 2006 Thanx soo much scott!just a few questions though, cause I want ot understand the code.what are clientX and clientY?LG Link to comment Share on other sites More sharing options...
scott100 Posted April 4, 2006 Share Posted April 4, 2006 Thanx soo much scott!just a few questions though, cause I want ot understand the code.what are clientX and clientY?LG<{POST_SNAPBACK}> They return the co-ordinates of the mouse position: http://www.w3schools.com/js/tryit.asp?file..._event_clientxy Link to comment Share on other sites More sharing options...
pulpfiction Posted April 4, 2006 Share Posted April 4, 2006 wow scott, awesome code......Pulpfiction. 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