jquery实现的div的显示和隐藏效果:
在网页的实际应用中,有些模块需要根据需要显示或者隐藏,下面就提供了几个这方面的实例,代码非常的简单,都是使用jquery自带的函数实现的,代码实例如下:
<!DOCTYPE html> <html> <head> <meta charset=" utf-8"> <title>div隐藏显示效果</title><style type="text/css">#mytest{ width:200px; height:200px; background-color:#090;}</style><script type="text/javascript" src='/images/loading.gif' data-original="http://www.softwhy.com/mytest/jQuery/jquery-1.8.3.js"></script><script type="text/javascript">function hiden(){ $("#mytest").hide();}function slideToggle(){ $("#mytest").slideToggle(2000);}function show(){ $("#mytest").show();}function toggle(){ $("#mytest").toggle(2000);}function slide(){ $("#mytest").slideDown();}</script></head><body><input type="button" value="隐藏" onclick="hiden()"/><input type="button" value="显示" onclick="show()"/><input type="button" value="窗帘效果显示" onclick="slide()"/><input type="button" value="窗帘效果的切换" onclick="slideToggle()"/><input type="button" value="隐藏显示效果切换" onclick="toggle()"/><div id="mytest"></div></body></html>
原文地址是:http://www.softwhy.com/forum.php?mod=viewthread&tid=8141
更多内容可以参阅:http://www.softwhy.com/jquery/
原标题:jquery实现的div的显示和隐藏效果
关键词:jquery