Jump to content

Drag mouse


Little Goat

Recommended Posts

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...