`
Forestsai
  • 浏览: 19591 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论

JQUERY 显示隐藏div

阅读更多
<html>  
<head>  
<title>show hide toggle</title>  
<script type='text/javascript' src="jquery/jquery-1.3.1.js"></script>  
<script language="javascript" type="text/javascript">  
    $(document).ready(function(){   
        $("#show").click(function(){   
            $("#showDiv").show(1000,alert(100));   
        });   
        $("#hide").click(function(){   
            $("#showDiv").hide(1000,alert(200));   
        });   
        $("#toggle").click(function(){   
            $("#showDiv").toggle(1000,alert(300));   
        });   
    });   
</script>  
<style>  
    .showDiv   
    {   
        width:200px;   
        height:200px;   
        border:1px red solid;   
    }   
</style>  
</head>  
  
<body>  
  
<div class="showDiv" style="display:none;" id="showDiv">show and hide</div>  
<p style="display: none">Hello</p>  
  
<input type="button" value="Show" id="show" />  
<input type="button" value="Hide" id="hide" />  
<input type="button" value="Toggle" id="toggle" />  
</body>  
</head> 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics