手机
当前位置:查字典教程网 >编程开发 >Javascript教程 >jQuery中show与hide方法用法示例
jQuery中show与hide方法用法示例
摘要:本文实例分析了jQuery中show与hide方法用法。分享给大家供大家参考,具体如下:*{font-size:12px;}div{widt...

本文实例分析了jQuery中show与hide方法用法。分享给大家供大家参考,具体如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <style type="text/css"> *{font-size:12px;} div{width:600px;margin:auto;} #control{background-color:gold;padding:10px;} </style> <script src="../js/jquery-1.5.1.min.js" type="text/javascript"></script> <script type="text/javascript"> $(function () { $("#btnDisplay").click(function () { $("#message").show(3000); }); $("#btnHide").click(function () { $("#message").hide(3000); }); }); </script> </head> <body> <div id="control"> <input id="btnDisplay" type="button" value="显示div" /> <input id="btnHide" type="button" value="隐藏div" /> </div> <div id="message"> mouseover、mouseenter的区别:div里套div。见备注。和事件冒泡有关系。<br /> 不论鼠标指针穿过被选元素或其子元素,都会触发 mouseover 事件 <br /> 只有在鼠标指针穿过被选元素时,才会触发 mouseenter 事件(穿过子元素不会触发) </div> </body> </html>

希望本文所述对大家jQuery程序设计有所帮助。

【jQuery中show与hide方法用法示例】相关文章:

javaScript中push函数用法实例分析

JS中字符串trim()使用示例

JavaScript中strike()方法的使用介绍

javascript中一些util方法汇总

js中setTimeout()与clearTimeout()用法实例浅析

JavaScript中的splice()方法使用详解

jQuery插件制作之全局函数用法实例

JQuery中Text方法用法实例分析

Jquery使用css方法改变样式实例

JQuery控制Radio选中方法分析

精品推荐
分类导航