Closed Thread Icon

Topic awaiting preservation: Dragable item + more Qs Pages that link to <a href="https://ozoneasylum.com/backlink?for=8206" title="Pages that link to Topic awaiting preservation: Dragable item + more Qs" rel="nofollow" >Topic awaiting preservation: Dragable item + more Qs\

 
Author Thread
Hugh
Paranoid (IV) Inmate

From: Dublin, Ireland
Insane since: Jul 2000

posted posted 06-07-2002 18:19

edit: Just see below , what was here before wasnt very clear.



[This message has been edited by Hugh (edited 06-09-2002).]

Dracusis
Maniac (V) Inmate

From: Brisbane, Australia
Insane since: Apr 2001

posted posted 06-07-2002 21:07

Hugh, ever seen one of these ---> . <--- Their called full-stops. Please use them...

I have no idea what your takin about.

DocOzone
Maniac (V) Lord Mad Scientist
Sovereign of all the lands Ozone and just beyond that little green line over there...

From: Stockholm, Sweden
Insane since: Mar 1994

posted posted 06-07-2002 22:25

I think I know what you're talking about, but only cause I've dealt with this so many times. When you click on the slider (or whatever you call the draggable bit) the mouse position is not the same as the top-left of the dragging bit, it's actually *offset* just a few pixels, where you clicked. When the dragging starts, you need to compare the mouse x-y coordinates with the top-left of the bit that is being dragged, and save that offset value in a variable. Now the dragged layers position is the mouse coordinates, minus that offset. It sounds like you're nearly there, give that a try.

Your pal, -doc-

Hugh
Paranoid (IV) Inmate

From: Dublin, Ireland
Insane since: Jul 2000

posted posted 06-08-2002 16:22

Okay .. let me try again (with proper punctuation, you should see essays I write, I can for ages with out a single full stop)

I understand the offset, I was just saying how important is it ? I dont mind if the bar jumps a little when its clicked on. But is that why it wont work in other browsers ? (my code works in IE and okay in NS6, it keeps 'dropping' the layer')

And are they usually triggered by onmouseup&down ? should I be using onmouseover&out aswell?

Does anyone know where I can get the shortest code possible to do this ? .. without the code being compressed etc..

And then .. why is Mozilla so slow ? and is there any wee tricks I can do, like have all the timeouts running together or something ?

And can I get the mouse coords when I need them, instead of setting it so when the mouse moves at anytime it runs a mouseHandler function?
_

new question: I dont like classes becuase they make unused variables(and they confuse me at times), so would it be smart to get a document.write to use a different JS file for IE/NS4/DOM. So everytime a layer is moved it doesnt have to use three ifs everytime to figure out which code to use ? Something classes can be set up to do. And does using eval(layerstart+layername+layerend+"fdsfss") slow down the shindig a lot ? what I dont like about it is you cant reffer to it backwards, like document.all.layer1.style.left=document.all.layer2.style.top+45;

I hope I was clearer this time.

oh and finally ... with classes , ive seen this being written:
myClass.prototype() {
...... all sorts of functions and stuff ....
}
Whats .prototype ?

« BackwardsOnwards »

Show Forum Drop Down Menu