me again.
i've got a blog that im working on, and basicly what i want is a javascript that when you click on a link, the comments for the day's post will become visible under the post. so just some thing to show and hide (with the same link) div really.
i've looked all around the web but can;t really find anything usefull.
Javascriptshow hide div
Page 1 of 1
4 Replies - 1177 Views - Last Post: 04 July 2003 - 12:53 PM
Replies To: Javascript
#2
Re: Javascript
Posted 03 July 2003 - 03:58 PM
i believe you need to combine it with css's "visibility" property. do a search for that and you should come up with something good (it's been years since i tried it ;)
#3
Re: Javascript
Posted 03 July 2003 - 06:02 PM
i've done that before, but the javascript takes advantage of the <ul> and <li> tags...i'll see if i can find my code for that
#4
Re: Javascript
Posted 04 July 2003 - 02:57 AM
You can try to use the css "display" property. Set it to "block" to view it and set it to "none" to make it invisible.
#5
Re: Javascript
Posted 04 July 2003 - 12:53 PM
i found this, it was actually in the new version of invision board, and it does exactly what i want
and the link to activate it (incase someone else wants this scipt)
justa quick note, you need a div named DIVID_open (replace DIVID with the name you want, obviously), but you don't need the _closed version, well i don't have it though.
<script language="Javascript" type="text/javascript">
function ShowHide(id1, id2) {
if (id1 != '') expMenu(id1);
if (id2 != '') expMenu(id2);
}
function expMenu(id) {
var itm = null;
if (document.getElementById) {
itm = document.getElementById(id);
} else if (document.all){
itm = document.all[id];
} else if (document.layers){
itm = document.layers[id];
}
if (!itm) {
// do nothing
}
else if (itm.style) {
if (itm.style.display == "none") { itm.style.display = ""; }
else { itm.style.display = "none"; }
}
else { itm.visibility = "show"; }
}
//-->
</script>
and the link to activate it (incase someone else wants this scipt)
<a href="javascript:ShowHide('DIVid_open','commentsDIVid_closed');">
justa quick note, you need a div named DIVID_open (replace DIVID with the name you want, obviously), but you don't need the _closed version, well i don't have it though.
Page 1 of 1
|
|

New Topic/Question
Reply


MultiQuote




|