[Javascript] Moving elements/forgot to ask you

BEKIM BACAJ trojani2000 at hotmail.com
Tue Apr 15 13:15:17 CDT 2003


Andrew, regarding 'object expected' error on my previous script.
Can you tell, when does it ocurr? Over what element(s) because I don't 
recieve nothing alike(IE5.0;IE6.0).

Regards!







>From: "Andrew Gibson" <andyg at ihug.co.nz>
>Reply-To: "[JavaScript List]" <javascript at LaTech.edu>
>To: "[JavaScript List]" <javascript at LaTech.edu>
>Subject: Re: [Javascript] Moving elements
>Date: Sat, 12 Apr 2003 11:31:24 +1200
>
>Bekim, I've copied this script as is....what is it supposed to do.....
>
>Just comes up with object required when I try to drag something.
>
>/*********************************************************************
>Title:       "Acrobat-Like" Page Scroll Script
>Written by:   Bekim Bacæ Trojani
>Date:         1:10 PM 4/1/03
>Instructions: To remove scrollbars and retain scrollability
>       Include: style="overflow:hidden" in the <Body> tag
>Compatibility:IE only (this version) version 1.0ie(beta)
>**************Please keep this coment lines if you use it*************
>**********************************************************************/
>var x, y, dx, dy, dB=document.body;
>function enableMove(){
>dB.style.cursor="move" //can't make it work!
>           x=event.screenX
>y=event.screenY
>     dx=x+dB.scrollLeft
>     dy=y+dB.scrollTop
>}
>
>function movingNow(){
>if (window.event.button==1) {
>x=event.screenX
>y=event.screenY
>    dB.scrollLeft = 0-(x-dx)
>    dB.scrollTop  = 0-(y-dy)
>         dB.style.cursor="move"
>}
>}
>
>function setItBack(){dB.style.cursor='';}
>
>function retF(){return false}
>
>document.onmousedown  =enableMove
>document.onmousemove  =movingNow
>document.onmouseup    =setItBack
>document.onselectstart=retF
>document.ondragstart  =retF
>
>It works as charm, very usefull for maps, especialy in popup windows etc.
>
>Excuse my math, is't very unconvetional.
>
>Once you've played around with this script, you will allready miss it at
>other pages.
>(P.S. Might work perfect in >NN4 also, but never tested it)
>
>Cheers!
>
>
>
>


_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE* 
http://join.msn.com/?page=features/virus



More information about the Javascript mailing list