[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Javascript rubber band animation between mouse(x,y) and mousedown

Posted on 2004-11-21
7
Medium Priority
?
1,557 Views
Last Modified: 2013-11-19
Hi,
We are looking for an animated line that turns on at mouse down and off at mouse up and goes between the current mouse position and the original mousedown position.

0
Comment
Question by:mcm-mgm
  • 4
  • 2
7 Comments
 
LVL 31

Accepted Solution

by:
GwynforWeb earned 2000 total points
ID: 12641419
non vertical/horzontal lines are possible but require one hell of a lot  of code
0
 
LVL 3

Expert Comment

by:wzd3
ID: 12641836
You might want to start with a graphics package already written.  Take a look at http://www.webreference.com/programming/javascript/gr/column2/2.html

It has a line drawing function already in it and refers to a demo page at http://www.silver-daggers.co.uk/demo/graphics.html

0
 
LVL 3

Expert Comment

by:wzd3
ID: 12641990
Well, it's a little sluggish, but look at http://home.earthlink.net/~wzd3/rubberband.html

It uses the graphics package referred to above.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Expert Comment

by:wzd3
ID: 12642008
Forgot to say, be sure to click/release in the red box.  Drawing stops when the mouse leaves the box.  The box is just a DIV so you can make it whatever size you like.
0
 

Author Comment

by:mcm-mgm
ID: 12648302
I am going to wait for a better solution.  I looked at what you have proposed and found it doesn't work for explorer, is bulky and slow in other browsers.

The solution I am looking for should be fast and light, and powerful.
0
 
LVL 3

Expert Comment

by:wzd3
ID: 12648978
I agree.  I just tried it to see how the graphics package worked, and was a little surprised at how slow it seemed.  I suspect you may want to looking other solutions than JavaScript.  Maybe shockwave?  I don't know much about its limits, but I think it is more amenable to realtime graphics.
0
 

Author Comment

by:mcm-mgm
ID: 12674426
Do you think it is possible to use a table and an tiny image on a div.  Set the table border to 0, and stretch the image from pointclick to mousenow, redrawing on mouse move?
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question