Forum Moderators: open
<script language="Javascript">
function toggle( targetId ) {
if ( document.getElementById ) {
target = document.getElementById( targetId );
if ( target.style.display == "none" ) {
target.style.display = "";
} else {
target.style.display = "none";
}
}
}
</script> and the html of the toggle:
<p><img src="img.jpg" width="57" height="43" /> <a href="javascript:toggle('railpump')">Rail Pump <span class="readmore">↓ show/hide </span></a></p>
<div id="railpump" style="display: none;">
<p class="subhead">Text</p>
<p><img src="resources/pumpbench.jpg" width="300" height="225" /></p>
<p>Blah blah explanation text</p>
<p><a href="#top">» back to top</a></p>
<p> </p>
</div> THANK YOU!
line 10, invalid character
which is this line:
if ( document.getElementById ) {
I realize I'm going to have to learn some of this (in my free time!) but over my head here. Is this just IE mac -- and I won't worry about it then --- or does it have potential to fall apart in other browsers?
<script language="Javascript">
function toggle( targetId ) {
if ( document.getElementById ) {
target = document.getElementById( targetId );
if ( target.style.display == "none" ) {
target.style.display = "";
} else {
target.style.display = "none";
}
}
}
</script>
Well, the client is testing on a pc and loves it, ff works on the mac; as long as ie7 doesn't ruin everything, the old code will work.
If the curious without a mac have other suggestions, I'm still willing to try and let you know how it goes.