一、 显示与隐藏——hide(),show()
1. 方法:
- hide(speed,[callback]);
- show(speed,[callback]);
说明:这两个方法还可以实现带动画效果的显示隐藏。speed可以是“slow"(600毫秒)、"normal"(400毫秒)、"fast"(200毫秒),可以直接是毫秒数。
callback是动画执行完的回调函数。
2.实例:
<style type="text/css"> body { font-size: 13px; } .artFram { border: solid 1px #ccc; background-color: #eee; width: 260px; padding: 8px; word-break: break-all; } .artList { line-height: 1.8em; } </style> <div class="artFram"> <div class="artList"> <span> </span> <span>jQuery</span> <span style="display:none">--write less,do more.</span> <a href="javascript:void(0)">显示</a> </div> </div>