尘风
红尘往事,一切随风

<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <title></title>
    <style>
    .left div,
    .right div {
        width: 100px;
        height: 50px;
        padding: 5px;
        margin: 5px;
        float: left;
        border: 1px solid #ccc;
    
    }
    .left div {
        background: #bbffaa;
    }
   
    .right div {
        background: yellow;
    }
    </style>
    <script src="https://lib.sinaapp.com/js/jquery/1.9.1/jquery-

1.9.1.min.js"></script>
</head>

<body>
    <h2>slideDown</h2>
    <div class="left">
        <h4>测试一</h4>
        <div class="a" id="a1">hide-show</div>
      <select id="cs" >
       <option value="1">向下</option>
        <option value="2">向右</option>
        <option value="3">淡出</option>
        <option value="4">淡入</option>
      </select>
     <button class="qd">确定</button>
    </div>
    <div class="right">
        <h4>测试二</h4>
        <div class="b" id="a2">hide-show</div>
        <button>点击slideDown执行回调</button>
    </div>
        <script type="text/javascript">
          $(".qd").click(function(){
             var v =$("#cs").val()
             if(v == "1"){$(".a").animate({height:300},3000)}
             else if(v == "2"){$(".a").animate({width:500},3000)}
             else if(v == "3"){$(".a").animate({opacity:0.2},3000)}
             else if(v == "4"){$(".a").animate({opacity:1},3000)}
          })
         
        
        </script>
</body>


</html>

posted on 2020-09-07 23:48  一个行者  阅读(152)  评论(0编辑  收藏  举报