• JS——jquery UI


        1. draggable()

    滑动条demo:

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
        <style type="text/css">
            .con{
                300px;
                height:300px;
                border:1px solid #000;
                margin:50px auto 0;
            }
    
            .box{
                50px;
                height:50px;
                background-color:hotpink;
                cursor:pointer;
            }
        </style>
        <script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>
        <script type="text/javascript" src="js/jquery-ui.min.js"></script>
        <script type="text/javascript">
            $(function () {
                //使得box可以鼠标拖动
                $('.box').draggable({
                    //约束元素在父级内拖动
                    containment:'parent',
                    //约束元素只能横向拖动
                    axis:'x',
                    //元素拖动时透明度变为0.6
                    opacity:0.6,
                    //ui里面有什么可以用console.log(ui)查看
                    drag:function (ev,ui) {
                        var nowleft = ui.position.left;
                    }
                });
            })
        </script>
    </head>
    <body>
        <div class="con">
            <div class="box"></div>
        </div>
    </body>
    </html>
  • 相关阅读:
    Object的公用方法
    Java的特点
    Set集合
    Java语言的三大特性
    List集合
    Collection类
    HashSet
    Codeforces1141F2 Same Sum Blocks (Hard)
    Codeforce1176F Destroy it!
    jzoj 5348. 【NOIP2017提高A组模拟9.5】心灵治愈
  • 原文地址:https://www.cnblogs.com/gaoquanquan/p/9226534.html
Copyright © 2020-2023  润新知