PDA

View Full Version : Any Link CSS doesn't work with IE 10 in an iframe.



erick4x4
05-20-2013, 03:24 PM
1) Script Title: AnyLink CSS Menu v2.3

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

3) Describe problem:
The script does not work correctly in Internet Explorer in an iframe. When in an iframe the menu disappears as soon as you hover over it.

Example:
http://growingcheerfulgivers.com/test.html (demo script, works fine)
http://growingcheerfulgivers.com/testiframe.html (simple page that only has 1 iframe on it that includes the test.html page), doesn't work.

Is this a bug, or am I doing something wrong? Deep in the JS code I notice some conditional checks for IE and iframes, and I wonder if that is the problem?

jscheuer1
05-20-2013, 04:13 PM
Using a text only editor like NotePad, find these lines in the script:


if (document.attachEvent && parent.length>0) //account for page being in IFRAME, in which above doesn't fire in IE
this.addEvent([window], function(){functionref()}, "load");

Make it like so (additions red, line may wrap):


if (!window.addEventListener && document.attachEvent && parent.length>0) //account for page being in IFRAME, in which above doesn't fire in IE 8 and less
this.addEvent([window], function(){functionref()}, "load");

Save and use that version.

The browser cache may need to be cleared and/or the page refreshed to see changes.