You are currently viewing the BOOK: JavaScript 24-Hour Trainer section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
The program in the book doesn't work properly. I typed in all and couldn't find any mistakes and then finally check the downloaded code which also doesn't work properly. In fact you get some pretty funky behavior that I haven't yet figured out the why of. It works fine if you drag the navy box and them the green box alternately but if you try to drag and drop and then drag and drop either of the boxes twice (or more in a row) things go wrong in a quite interesting way. The box remains where it is and a semi-transparent box follow along with the mouse cursor and only when you let go does the solid box jump to the new position. Then sometimes the box is stuck to the mouse cursor as if the mouseup was missed and it is necessary to click again to get the box and the mouse separated. I'd love to hear from J. McPeak how to fix this, and how to explain what accounts for the semitransparent box.
I've tested in IE9, Chrome 16, and Firefox 7. The only browser that gives me unexpected results is Firefox 7. From the looks of it, the browser's built-in drag-n-drop functionality kicks in and causes some issues with the script. I'll look into it in a few days.
It's been quite a while and you said you'd have an answer in a few days. I'm wondering if you are stumped or if you are going to say anything more about the fact that the drag and drop program in chapter 24 doesn't work in the current version of Firefox? Is this a bug in Firefox that should be reported? Is there a way to write a drag and drop script in JavaScript that would work in the current version?
I tried to contact you through your homepage but the contact page did not work. I kept getting a message that there was an error and to try again.
I did respond to you request for the version number of Firefox that I'm using. Here it is again: 9.01 is what it says under Help -> about Firefox.