View Full Version : click to show more thing


xxjenjxx
02-08-2003, 08:24 PM
does any one know how to do that thing when you click on a link and it shows up more on the page
for example when people have little introductories to themselves theres somtimes a little more? bit at the end which opens up below the writing

it hink its javascript not too sure
ok well if you knwo waht im on about pelase help!
thanks
jen
x

starlet
02-09-2003, 01:23 AM
in the <head> section

<script language="javascript">
<!--
var state = 'hidden';

function showhide(layer_ref) {

if (state == 'visible') {
state = 'hidden';
}
else {
state = 'visible';
}
if (document.all) { //IS IE 4 or 5 (or 6 beta)
eval( "document.all." + layer_ref + ".style.visibility = state");
}
if (document.layers) { //IS NETSCAPE 4 or below
document.layers[layer_ref].visibility = state;
}
if (document.getElementById && !document.all) {
maxwell_smart = document.getElementById(layer_ref);
maxwell_smart.style.visibility = state;
}
}
//-->
</script>

In the body where you want the link
<a href="javascript:// "onclick="showhide('agent99');">Show more</a>

Where you want the 'extra' stuff to appear
<div id="agent99" style="position:absolute; top:132px; right:70px;
visibility:hidden;">
Stuff
</div>

xxjenjxx
02-09-2003, 10:26 AM
thank you!