...

View Full Version : Anyone give me a slide function?



Dave.
11-08-2011, 09:54 PM
Hi! Can anyone help me make this spoiler slide open and close instead of just appear and disappear? I'd be really grateful :D


<html>
<head>
<link href="http://fallscountanywhere.com/bbcodes/spoiler.css" rel="stylesheet" type="text/css" media="screen" />


<script type="text/javascript">
function showSpoiler(btn, show)
{
var node = btn;
while ( node.className == null || node.className != "spoiler" )
{
node = node.parentNode;
if ( node == null )
{
alert("The html for spoiler is invalid");
return;
}
}
var inners = node.getElementsByTagName("div");
inners[0].style.display = show ? "none" : "block";
inners[1].style.display = show ? "block" : "none";
}
</script>
</head>

<body>
<div class="spoiler">
<img src="http://i.imgur.com/6Uq7Y.png" align="right">
<div class="inner">
<input type="button" onclick="showSpoiler(this, true);" value="Show" />
</div>
<div class="inner" style="display:none;">
<input type="button" onclick="showSpoiler(this, false);" value="Hide" />
<div class="text">{param}</div>
</div>
</div>
</body>
</html>

jassi.singh
11-09-2011, 06:23 AM
Refer: http://www.iwdn.net/showthread.php?t=5637
http://www.dhtmlgoodies.com/index.html?whichScript=show_hide_content_slide
http://www.prodeveloper.org/j-post-slider-WordPress-plugin-jquery-post-animation-show.html



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum