教程集 www.jiaochengji.com
教程集 >  jQuery  >  jquery 教程  >  正文 jquery show与hide方法的例子

jquery show与hide方法的例子

发布时间:2015-12-18   编辑:jiaochengji.com
本文介绍了jquery show hide方法的用法,有关jquery show hide方法的例子,有需要的朋友参考下。

例子,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>jquery show hide方法_www.jbxue.com</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 hide与show方法隐藏与显示标签
jquery show()方法与hide()方法的小例子
jquery show()方法与hide()方法(示例)
jquery 延迟执行的实例分享
jquery隐藏标签、显示标签的例子
jquery show与hide方法的例子
jquery中show()、hide()方法的用法
jquery显示、隐藏div的方法举例
jquery 延迟执行实例介绍
关于jQuery参考实例 1.0 jQuery的哲学

关键词: hide  show   
[关闭]
~ ~