Hello,
I’ve been working on this for hours and thought I’d see if someone could help. I’m trying to make a toggle button that will turn on and off the visibility of a calendar i’m bringing in on iframe. I’ve done it with two buttons here:
[url]http://jbrown.cc/calendar/testcal.html
But i can’t figure out how to do it with one button. Thanks for any help you can give, and let me know if anyone knows a better way to do this with js or css. Below is the code i’ve done to toggle with two buttons:
[QUOTE]
<HTML>
<SCRIPT>
function hide(el)
{
document.getElementById(el).style.visibility;
if (currentVisibility == ‘hide’) {
currentVisibility = ‘show’
}
else{
currentVisibility = ‘hide’
}
}
</SCRIPT>
</head>
<BODY>
<DIV ID=”calendar” NAME=”calendar”>
<IFRAME ID=”iframe1″ CLASS=”InlineBdr” WIDTH=”300″ HEIGHT=”400″ BORDER=”0″ FRAMEBORDER=”no” SRC=”
</DIV>
<INPUT TYPE=”button” VALUE=”hide” onClick=”document.getElementById(‘calendar’).style.visibility = ‘hidden’;”>
<INPUT TYPE=”button” VALUE=”show” onClick=”document.getElementById(‘calendar’).style.visibility = ‘visible’;”>
</BODY>
</HTML>