Expand script

Any problem with javascript can be discussed here.
Post Reply
User avatar
Lisk
Posts: 327
Joined: Sat Mar 05, 2005 4:47 pm
Contact:

Expand script

Post by Lisk »

<script language='JavaScript'>
function expand_content(span)
{
displayType=(****.getElementById(span).style.display=='none') ? 'block':'none';
****.getElementById(span).style.display=displayType;

}

</script>

0001 -expand-
<span id="0001" style="display: none">expanded, wow!
</span>

This is what I use, but is there anything... smaller/faster w/e?


ELRocco
Posts: 46
Joined: Sun Feb 20, 2005 3:19 am
Contact:

Post by ELRocco »

thats a cool script it will work in all browsers and is very simle you do it youtrself?
User avatar
Lisk
Posts: 327
Joined: Sat Mar 05, 2005 4:47 pm
Contact:

Post by Lisk »

Never tried. Never got "it doesnt work" comments", so it should.

Don't remember, probably got it off somewhere.
ELRocco
Posts: 46
Joined: Sun Feb 20, 2005 3:19 am
Contact:

Post by ELRocco »

ya it works, if you ever want to test a script just use photobuckets html test
http://photobucket.com/practice.php
kaos_frack
Posts: 504
Joined: Sat May 07, 2005 8:03 am
Contact:

Re: Expand script

Post by kaos_frack »

Lisk wrote:<script language='JavaScript'>
function expand_content(span)
{
displayType=(****.getElementById(span).style.display=='none') ? 'block':'none']0001 -expand- [/url]
<span id="0001" style="display: none">expanded, wow!
</span>

This is what I use, but is there anything... smaller/faster w/e?
well i don't know any other way that is faster
but probably you can shorten your script
Post Reply