Click to See Complete Forum and Search --> : reproduce the acrobat «HAND TOOL»
Ice3T
09-30-2003, 05:27 PM
I would like to reproduce the acrobat «HAND TOOL» on a ie6 web page. I would HOLD [ space bar + left mouse ] to use it, like in photoshop or acrobat.
I guess I would apply a scroll according to the mouse mouvements, but I don't know how to follow the mouvements of the mouse.
Has someone seen this before.
LittleRed
10-01-2003, 03:18 AM
you can use CSS to do it,
there's a list with the available types:
http://www.btinternet.com/~wildfire/reference/cssmousecursor.htm
Originally posted by LittleRed
there's a list with the available types:
http://www.btinternet.com/~wildfire/reference/cssmousecursor.htm That is an inaccurate list, however. You can find a list of valid cursors at http://www.w3.org/TR/REC-CSS2/ui.html#cursor-props
Ice3T
10-01-2003, 04:25 PM
Thank you both, but I Am not looking for style=cursor:hand.
I want to reproduce the tool its self: you «grab» the document and move it.
Yo know, just imagine this (or do it) to understand what I mean.
-Open a .pdf file and zoom it to 200%.
Do you see... you can now use the «HAND TOOL» to «pan» the document because it won't fit in the window. It is much more efficient than using the scroll bars.
-Am I clear at all? Do I make any sence?
Thanks
Ice3T
10-04-2003, 05:26 PM
There we go:
(hold the Ctrl key and move mouse to se effect)
<html>
<head><title>Scroll</title></head>
<body onKeyUp=func03() onMouseMove=func01() onKeyDown=func02() style=margin:0;overflow:hidden>
<script language=javascript>
<!--
var ctr=0, MPx, MPy, sl, st;
function func01(){
if(ctr==1){document.body.scrollLeft=sl+(MPx-event.clientX); document.body.scrollTop=st+(MPy-event.clientY);};
}
function func02(){
if(window.event.keyCode==17){ctr=1; st=document.body.scrollTop; sl=document.body.scrollLeft; MPy=event.clientY; MPx=event.clientX; document.body.style.cursor='move';}
}
function func03(){
if(window.event.keyCode==17){ctr=0; document.body.style.cursor='default'}
}
-->
</script>
<p><img border="0" src="http://www.google.com/images/logo.gif" width="150%" height="150%"></p>
</body>
</html>
thanks to the search form and all who posted in this forum
Here's the basic stuff:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>Basic Acrobat Scroll</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
//<![CDATA[
<!--
// set event handler
if(document.addEventListener) {
document.addEventListener('mousedown', Acrobat, false);
document.addEventListener('mouseup', Acrobat, false);
}
else {
document.onmousedown=Acrobat;
document.onmouseup=Acrobat;
}
var PosTop=0;
var PosLeft=0;
function Acrobat(event) {
var e=(window.event)? window.event : event;
switch (e.type) {
case "mousedown" :
PosTop=e.screenY;
PosLeft=e.screenX;
break;
case "mouseup" :
PosTop=(e.screenY-PosTop);
PosLeft=(e.screenX-PosLeft);
window.scrollBy(PosLeft, PosTop);
PosTop=PosLeft=0;
break;
default : alert("unknown event type");
}
}
//-->
//]]>
</script>
</head>
<body>
<p><img border="0" src="http://www.google.com/images/logo.gif" width="500" height="100"></p>
<p>Confirmat autem illud vel maxime, quod ipsa natura, ut ait ille, sciscat et probet, id est voluptatem et dolorem. ad haec et quae sequamur et quae fugiamus refert omnia.
quod quamquam Aristippi est a Cyrenaicisque melius liberiusque defenditur, tamen eius modi esse iudico, ut nihil homine videatur indignius.
ad maiora enim quaedam nos natura genuit et conformavit, ut mihi quidem videtur.
ac fieri potest, ut errem, sed ita prorsus existimo, neque eum
</p>
<p>Torquatum, qui hoc primus cognomen invenerit, aut torquem illum hosti detraxisse, ut aliquam ex eo perciperet corpore voluptatem,
aut *** Latinis tertio consulatu conflixisse apud Veserim propter voluptatem; quod vero securi percussit filium,
privavisse se etiam videtur multis voluptatibus, *** ipsi naturae patrioque amori praetulerit ius maiestatis atque imperii. [24] quid? T. Torquatus, is qui consul *** Cn. Octavio fuit,
*** illam severitatem in eo filio adhibuit, quem in adoptionem D. Silano emancipaverat, ut eum Macedonum legatis accusantibus,
quod pecunias praetorem in provincia cepisse arguerent, causam apud se dicere iuberet reque ex utraque parte audita pronuntiaret eum non talem videri fuisse in imperio, quales eius maiores fuissent,
et in conspectum suum venire vetuit, numquid tibi videtur de voluptatibus suis cogitavisse?
</p>
</body>
</html>