Zjmainstay

canrun

View Code
<!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>点击消失的DIV</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="Content-Language" content="zh-CN" />
    <script type="text/javascript" src="https://files.cnblogs.com/Zjmainstay/jquery-1.6.2.min.js"></script>
</head>
<body>
<style>
#adBlock{
    display:block;
    width:200px;
    height:300px;
    border:1px solid;
    float:left;
}
#clickController{
    border: 1px solid #AABBCC;
    display: block;
    float: left;
    height: 80px;
    padding: 1px;
    width: 16px;
}
</style>
<div id="adBlock"></div>
<div id="clickController"><< 点击我</div>
<script type="text/javascript">
$(document).ready(function(){
    $("#clickController").click(function(){        
        ($(this).text()==\'>> 点击我\')?$(this).text(\'<< 点击我\'):$(this).text(\'>> 点击我\');
        $("#adBlock").toggle(500);
    });
});
</script>
</body>
</html>

分类:

技术点:

相关文章:

  • 2021-10-02
  • 2022-12-23
  • 2022-01-29
  • 2021-11-05
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-18
  • 2022-03-07
  • 2021-12-18
  • 2021-12-18
  • 2021-12-18
  • 2022-12-23
相关资源
相似解决方案