JavaScript

Moderators: None (Apply to moderate this forum)
Number of threads: 2061
Number of posts: 5164

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
help with animation pending on cursor Posted by jameslat on 16 Mar 2010 at 5:51 AM
Hey-
I am trying to make a JS animation for my website.
What i want is wherever the user clicks the X,Y will be saved onto a tempX, tempY varible and as the user drags the mouse a X,Y line will follow the cursur, thus creating a box.(need help here)
whenever the user let's go of the drag the box stops and saves the x,y
so baicaly i want to make some code that will find the x,y of a square
left:
top:
width:
height:
I know how to find the current X,Y of just the mouse, but i need help with having js draw it on the screen.
can js do this? Where can i go to learn how to make JS animations?
thanks for any help :D
-James
Report
Re: help with animation pending on cursor Posted by CyGuy on 22 Mar 2010 at 9:42 PM
If you would still like to do this, I can help... First you will want to alert the x,y coordinates twice: on mousedown then on mouseup. Try that and let me know.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.