PDA

View Full Version : AnyLink JS Drop Down Menu v2.0 works in Safari and Firefox but does not work in IE



corax
11-11-2010, 12:17 AM
1) Script Title: AnyLink JS Drop Down Menu v2.2

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/dropmenuindex.htm

3) Describe problem:
This menu works fine in Safari and Firefox but not in IE. The menu at the top of the page should have the drop down effect. Any help would be appreciated. Page is posted here:

http://www.alpinism.com/New/index.html

Pertinent files are attached

jscheuer1
11-11-2010, 07:34 AM
The file alpinism.com/New/anylinkmenu.js has an added line break in it:


domready:function(functionref){ //based on code from the jQuery library
if (dd_domreadycheck){
functionref()
return
}
// Mozilla, Opera and webkit nightlies currently support this event
if (document.addEventListener) {
// Use the handy event callback
document.addEventListener("DOMContentLoaded", function(){
document.removeEventListener("DOMContentLoaded", arguments.callee, false )
functionref();
dd_domreadycheck=true
}, false )
}
else if (document.attachEvent){
// If IE and not an iframe
// continually check to see if the document is ready
if ( document.documentElement.doScroll && window == window.top) (function(){
if (dd_domreadycheck) return
try{
// If IE is used, use the trick by Diego Perini
// http://javascrip
t.nwbox.com/IEContentLoaded/
document.documentElement.doScroll("left")
}catch(error){
setTimeout( arguments.callee, 0)
return;
}
//and execute any wai . . .

should be:


domready:function(functionref){ //based on code from the jQuery library
if (dd_domreadycheck){
functionref()
return
}
// Mozilla, Opera and webkit nightlies currently support this event
if (document.addEventListener) {
// Use the handy event callback
document.addEventListener("DOMContentLoaded", function(){
document.removeEventListener("DOMContentLoaded", arguments.callee, false )
functionref();
dd_domreadycheck=true
}, false )
}
else if (document.attachEvent){
// If IE and not an iframe
// continually check to see if the document is ready
if ( document.documentElement.doScroll && window == window.top) (function(){
if (dd_domreadycheck) return
try{
// If IE is used, use the trick by Diego Perini
// http://javascript.nwbox.com/IEContentLoaded/
document.documentElement.doScroll("left")
}catch(error){
setTimeout( arguments.callee, 0)
return;
}
//and execute any wai . . .

Either correct that, or replace the file with a fresh copy from the demo page.

corax
11-11-2010, 04:07 PM
Thanks John.

Strangely the code is correct in the files on my hard drive but when I upload them to the server the code error shows up. I've uploaded all the .html .css and .js files to the server again with no luck. So tried replacing the code from the demo page onto the files on my hard drive and uploading all files again, with no luck. Tried editing the code and replacing the code on the file on the server with no luck.

Note that after all this I haven't been able to check compatibility with IE as I have to go downtown to check it out on a PC and haven't had time to do so this morning. I've just been opening the file on the server after trying the fixes and the error still shows.

I will be able to fiddle with this more tonight but at this point I'm stumped. Any ideas?

Thanks.

A few minutes later: I realize that the animatedcollapse.js file is getting corrupted on upload too, in a similar manner. This file was also take from the Dynamic Drive site. This js seems to be working OK in IE though, although not as completely smoothly as it could.

Thanks, Mark

jscheuer1
11-11-2010, 04:25 PM
Make sure that when uploading the correct anylinkmenu.js file that you are indeed doing it to the correct location on the server. Delete the bad one first to prevent the new one from becoming named slightly differently by the server or your upload client (unusual, but could happen). Use an ftp program, not some component of your editor or your host's online interface. Either of those two might alter the file.

Navigate directly to the file in Firefox and refresh to see if the change has taken affect.

If so, clear the cache in IE before viewing the page and while the page isn't open in any window or tab of IE. Then navigate to the page and hit refresh.