[Javascript] Moving elements with Javascript

Peter Brunone peter at brunone.com
Mon Nov 26 22:49:38 CST 2007


Sounds fairly simple; you could use absolute positioning to situate the elements (which is a bit of a pain to get right, but it's really the only way to get them moving).  Then you would adjust the style.left and style.top properties of the object, moving it incrementally using the Javascript setTimeout function, and when it reaches its destination, a simple style.display = "none" would make it disappear.

That's the bones of it, anyway; at least you have some terms to research :)

Peter

From: "Rafael Menezes" soscpd at gmail.com

DHTML is the tool i recommend to this task.
 
Regards
Rafael

 
On 26/11/2007, Alan Easton <alaneaston666 at hotmail.com> wrote: 

Hello everyone,
 
I have a question about moving elements from one part of the screen to another.
 
The situation is this. I am building a shopping cart, and would like to add a bit of fancy functionality. When a visitor clicks my "Add to Basket" icon, I would like the icon to then fly to a designated point on the screen, either to the top of the page, out of sight, or somewhere else on screen, then when it gets there, then to simply disappear. 
 
I am not sure how hard this is, but I did see it on Microsoft's site, and thought it looked very cool.
 
It is a cool feature to have, that's all, and I was wondering if any of you experts could help me out with it. 
 
Any help as always is greatly appreciated.
 
Many Thanks,
 
Alan...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20071126/85678c5a/attachment.htm>


More information about the Javascript mailing list