...

View Full Version : Conflicting Scripts



newseed
10-10-2008, 07:35 PM
This page: sma rtbrai ntech-com.ds5053.gre ybea rdhosting.com/who-does-it-help/success-stories.asp (remove spaces)

This script click_toggle.js is conflicting with the supersleight.js script. It's causing the png fix to not work (for IE6) on this page.

If I disable the body's onload function, the png fix works but then of course the functionallity of the click toggle doesn't do any good.

The onload is for the click toggle script.
<body onload="clickMenu('outer','div','more')">

I can't recall where but I have read something similar about the onload function conflicting with another script and then you add a line of code for one of the scripts but I don't recall where I read that.

I tried adding the following code to the end of the click_toggle.js script:

// Run when page loads
if (window.attachEvent) window.attachEvent("onload", clickMenu);

However, this didn't work at all.

Any help would be appreciated.

A1ien51
10-10-2008, 08:09 PM
well you are not including the parameters with your function call

see if this helps:



if (window.attachEvent) window.attachEvent("onload", function(){ clickMenu('outer','div','more'); });


Eric

newseed
10-10-2008, 08:17 PM
Thanks for the help. Unfortunately, that didn't work. The click_toggle.js script becomes non-functional.

You can review the changes via the same link I provide above.

newseed
10-10-2008, 08:19 PM
Thanks for the help. Unfortunately, that didn't work. The click_toggle.js becomes non-functional.

You can review the changes via the same link I provide above.

newseed
10-10-2008, 08:31 PM
Update: I assumed that the 'onload' needed to be removed from the <body> which is why it didn't work with the new line of code you've provided. Once I put that back in, the click toggle and the png fix works fine now.

Thanks for you help.

newseed
10-10-2008, 08:36 PM
Disregard my last post. I was looking at it via Firefox. The png still doesn't work with the onload statment in the <body> tag and the click toggle doesn't work if I remove it and use your suggested code.

Any suggestion would be helpful.

A1ien51
10-10-2008, 08:44 PM
You can not use the onload in the body [it is bad practice anyway!], you need that to also be attachEvent

Eric

newseed
10-10-2008, 08:55 PM
As it stands now, the body onload has been removed but this still doesn't resolve my conflict issue between the two scripts.

newseed
10-10-2008, 09:00 PM
Ok. Your suggestion does work. What's weird that the hover over the 'Read details >>' doesn't cover the whole length of the text but instead only just the far right portion of it. I didn't realize this until I accidently hovered over to the right more.

I just now need to resolve the hover issue.

Thanks for you help.

newseed
10-10-2008, 09:25 PM
Okay, it's working in IE6 without a hitch including the png fix but now the click toggle doesn't work in Firefox. Put the onload back in the body and the click toggle works but then the IE6 png fix doesn't.

Please note that the click toggle doesn't work in Safair either but it does work for IE7. Go figure.

Please advise.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum