zoukankan      html  css  js  c++  java
  • 20151116

     单击隐藏按钮将隐藏所有的<p></p>之间的所有内容,单击显示按钮后将会再次出现,刚才隐藏的所有<p></p>中的内容

    <!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>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <script type="application/javascript" src="jquery-1.11.3.min.js">
    </script>
    <script type="application/javascript">
    
    //$(document).ready(function() {$("p").hide()});
    $(document).ready(function() {
    $("#hide").click(function(){$("p").hide();});
    
    $("#show").click(function(){$("p").show();});
    });
    </script>
    
    </head>
    
    <body>
    <p>显示的内容</p>
    <input id="hide" type="button" value="隐藏" />
    <input id="show" type="button" value="显示" />
    </body>
    </html>

     隐藏按钮将class=a的所有行数用3s进行淡出隐藏,在此点击后3s内再淡入出现。

    显示按钮进行自我隐藏!

    <!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>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <script type="application/javascript" src="jquery-1.11.3.min.js">
    </script>
    <script type="application/javascript">
    
    //$(document).ready(function() {$("p").hide()});
    $(document).ready(function() {
    //$("#hide").click(function(){$("p").hide();});
    //$("#show").click(function(){$("p").show();});
    });
    </script>
    
    </head>
    
    <body>
    <p>显示的内容</p>
    <p class="a">显示的内容2</p>
    <div>div 显示</div>
    <input id="hide" type="button" value="隐藏" 
    onclick="$(this).click($('.a').fadeToggle(3000))" />
    <input id="show" type="button" value="显示" 
    onclick="$(this).click($(this).hide())" />
    </body>
    </html>
  • 相关阅读:
    低调 、隐忍、善良应是最应该修炼的
    达内C++培训课程
    这三天低效率开发的总结,我都做了些什么啊?
    linux sysfs(1)
    编码问题
    Linux中的system函数的实现和解释
    北京邮电大学 程序设计课程设计 电梯 文件输入版本(已调试,大致正确运行==)
    "Dallas" CTP3 发布通告
    结合使用PowerPivot 和 "Dallas" CTP3
    Windows Azure 解决方案系列: 能源监测减少支出,通过托管平台拓展业务
  • 原文地址:https://www.cnblogs.com/name-hanlin/p/4970374.html
Copyright © 2011-2022 走看看