PDA

View Full Version : Still Stumped...Anyone bored enough to help?



starlameris
07-18-2005, 12:37 PM
I'm still trying to work out the problem I posted about last week here:

http://www.dynamicdrive.com/forums/showthread.php?t=3818

I can't find the contradiction that's causing the problem. I know it's a ton of code but if anyone is willing to look over it, I will be eternally grateful and if you're ever in the Rochester area I will make you cookies.

-Stephanie

IanMarlowe
07-18-2005, 12:49 PM
what exactly is wrong?

starlameris
07-18-2005, 12:55 PM
I describe it in depth and have a link to the code (both the original on this site and the page I'm trying to implement it on) on the original post. Brief summary: When I try to drag and drop the popup box the cursor gets stuck in the middle of the top bar and won't release the window, the result being that unless you refresh the page you just have the window following your cursor around the screen.

IanMarlowe
07-18-2005, 01:00 PM
hmmm....your site looks fine to me... :(

starlameris
07-18-2005, 01:03 PM
hmmm....your site looks fine to me... :(


Weird. Mind telling me what platform/browser you're using?

IanMarlowe
07-18-2005, 01:04 PM
Ie 5...

jscheuer1
07-18-2005, 01:04 PM
10 to 1 will get you that it is the image map. Those things can cause all sorts of trouble with scripts. At the very least, try putting the coords info directly after this:
<img src="../graphics/cabinet-doors/applied-moulding/appliedmoulding.jpg" usemap="#appliedmoulding_Map" border="0">You are not supposed to have all that stuff in between. If that doesn't get it, try an experiment with just an image, instead of a map.

jscheuer1
07-18-2005, 01:18 PM
Ah, it is a script conflict (I took the other scripts off the page and it worked fine):

.

Aside from the tutorial above, which usually is the solution when the problem is two different scripts, you may need to consult:

http://www.howtocreate.co.uk/tutorials/index.php?tut=0&part=0&TOshow=allshow#refcon

Which explains how two scripts on the same page may not use the same set of variable names, id names, etc. This is especially important if the problem is two copies of the same script on a page but, can come into play with two different scripts when the first step won't fix it.

One other approach that works in both situations, if adaptable to one (or more) of the scripts, is to put one script in a borderless iframe. It will look like it is on the same page but, since it really is on a separate page, conflicts are no longer an issue.

Also, I notice you have combined a script with the viewer script. At least keep them separate.

mwinter
07-18-2005, 01:20 PM
The Macromedia script that creates your menus is rather antisocial and blindly assigns a listener to the onmouseup property of the document object[1]. This overwrites the listener used by the drag 'n drop script, and hence your problem. To solve this, you'll need to do a bit of restructuring.

First, move the script element that includes the Macromedia script so that it's the first script element in the document. Whilst you're at it, remove the language attribute from the starting tag (specifying "Javascript1.2" is bad idea).

Second, delete the script element that calls mmLoadMenus, currently located at the start of the body element.

Third, move the large inline script element into the body element (where the previous one was), and call mmLoadMenus just after it's defined in that block.

Finally, at the end of that script block, replace:


document.onmouseup=new Function("dragapproved=false")with:


document.oldmouseup = document.onmouseup;
document.onmouseup = function() {
if(this.oldmouseup) {this.oldmouseup();}

dragapproved = false;
};A nasty hack, but it should work.

Good luck,
Mike


[1] The drag 'n drop script does too, but you'd expect more from an international corporation. Well, not really I suppose; it is Macromedia :rolleyes:

starlameris
07-18-2005, 07:46 PM
Well it didn't actually end up working. (I probably misunderstood something somewhere in your instructions.) I ended up just taking out the drag and drop function so that it stays put in the middle of the screen. Hopefully I didn't screw things up too badly. :rolleyes:

Oh, and I do want to apologize for posting about the multiple scripts. I read those guidelines on Friday and somehow between then and now I completely forgot that one. Thanks for helping despite that. :)

-Stephanie