thePraeotirna
09-06-2006, 03:19 PM
1) Script Title: Switch Content Script
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/switchcontent.htm
3) Describe problem:
After editing the code to suit my purposes, it no longer works in IE. It's working fine in FF, but in IE, although the pointer changes on mouse over, clicking doesn't expand the block. I uploaded the exact version from the page where I found the script (the link above) and that one worked fine. I just can't figure out why it stopped working..
Here's exactly what I changed.
I removed this portion...
if (document.getElementById){
document.write('<style type="text/css">')
document.write('.switchcontent{display:none;}')
document.write('</style>')
}
.. and just put the css in the head. And I changed all mention of .switchcontent to .hide. As for the html, I'm using headers and divs in levels. 2 headers and three divs.
EXAMPLE:
<h1 onclick expand div1...></h1>
<div id=1>
<div>
<h2 onclick expand div2></h2>
<div id=2>Content</div></div></div>
As I said, this all works fine and dandy on FF, but IE doesn't even open the first level. Here's a link to the page I'm using it on so you can see the source code. Just let me know if you need me to copy/paste the javascript.
http://www.tsrealms.com/dictionary.shtml
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/switchcontent.htm
3) Describe problem:
After editing the code to suit my purposes, it no longer works in IE. It's working fine in FF, but in IE, although the pointer changes on mouse over, clicking doesn't expand the block. I uploaded the exact version from the page where I found the script (the link above) and that one worked fine. I just can't figure out why it stopped working..
Here's exactly what I changed.
I removed this portion...
if (document.getElementById){
document.write('<style type="text/css">')
document.write('.switchcontent{display:none;}')
document.write('</style>')
}
.. and just put the css in the head. And I changed all mention of .switchcontent to .hide. As for the html, I'm using headers and divs in levels. 2 headers and three divs.
EXAMPLE:
<h1 onclick expand div1...></h1>
<div id=1>
<div>
<h2 onclick expand div2></h2>
<div id=2>Content</div></div></div>
As I said, this all works fine and dandy on FF, but IE doesn't even open the first level. Here's a link to the page I'm using it on so you can see the source code. Just let me know if you need me to copy/paste the javascript.
http://www.tsrealms.com/dictionary.shtml