Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Sep 14th, 2006, 7:10 PM   #1
Jimbo
Battle Programmer
 
Jimbo's Avatar
 
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 763
Rep Power: 3 Jimbo is on a distinguished road
propagating mousemove events

For the site I'm currently working on, I'm trying to fix some JavaScript code that lets the user draw a box (a <div> with a border and transparent background) over an image. The box is resized via the onmousemove handler. It works by having the user click once, then move the mouse to another point (the opposite corner) and click again to pin the box down, if you will. The current code has equivalent onmousemove events defined for both the <img> and the <div> on top of it; the problem is that if the mouse moves slow enough (keeping the mouse coordinates inside the border), the user can make the <div> extend beyond the regions of the <img>.

What I would like to do is simply have the mousemove propagated to the <img> and then remove the handler from the <div>. This would restrict the box to being over the image no matter what, but if I just remove the handler, the mousemove event is stopped at by the <div> when the mouse backtracks, so the user can't shrink the box. The problem is that I don't know how to make the event propagate. I've spent a long time with google and nothing really says how to do what I want. Is there a way to do this?
Jimbo is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Detecting/Blocking Events in External Applications ZeeMan Visual Basic 0 Jun 28th, 2006 6:32 PM
Clone Node Events Eryk JavaScript and Client-Side Browser Scripting 2 Feb 24th, 2006 2:15 PM
question: usage of delagates and custom events melbolt C# 1 Oct 3rd, 2005 7:17 PM
How to handle keyboard events in an app containing ActiveX Controls ? George Giolfan Visual Basic .NET 0 Aug 7th, 2005 3:07 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:56 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC