• 页面悬浮窗(点击展开或者收缩)


    html代码:

    1 <div class="switch">
    2     <dl class="clearFix">
    3         <dt class="fl">
    4             点我试试
    5         </dt>
    6             <dd class="fl">
    7             </dd>
    8     </dl>
    9 </div>

    css代码:

    1 .switch{position:absolute;right:0;top:100px;height:400px;overflow: hidden;cursor: pointer;}
    2 .switch dt{width: 30px;padding:100px 10px;height: 200px;text-align:center;font-size: 20px;color: #fff;background: #45b035;}
    3 .switch dd{width: 0px;height: 400px;background: url(img01/11.jpg);}

    js代码:

    <script type="text/javascript">
        $("dt").on("click",function(){
            Switch(".switch dd");                        
        })
        function Switch(Obj){
            if($(Obj).width()==0){
                $(Obj).animate({
                    width:"400px"
                },1000);
            }else{
                $(Obj).animate({
                    width:"0px"
                },1000);
            }
        }
    </script>

    效果如下:

  • 相关阅读:
    6 、 图论—NP 搜索
    5 、 数值计算
    4 、 数论
    3 、 结构
    2 、 组合
    1 、 几何
    Dikstra 堆优化板子
    SPFA板子
    C++优先队列例子
    一些类使用的模板
  • 原文地址:https://www.cnblogs.com/rain92/p/5587711.html
Copyright © 2020-2023  润新知