web可拖动控件js

先下载:http://code.jquery.com/ui/1.10.3/jquery-ui.js

$('.i-i-yuan').draggable({
                containment: '#app'//可通过设置拖动范围的div的id来限制拖动空间的移动范围
            });

 

.i-i-yuan{
    position: fixed;
    cursor: pointer;
    right: 50px;
    bottom: 50px;
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 50px;
    color: #B60000;
    border-radius: 50%;
    box-shadow: 0 5px 10px rgba(0, 0, 0, .5);
    background: -webkit-linear-gradient(#ffc000, #c59e29); /* Safari 5.1 - 6.0 */
    background: -o-linear-gradient(#ffc000, #c59e29); /* Opera 11.1 - 12.0 */
    background: -moz-linear-gradient(#ffc000, #c59e29); /* Firefox 3.6 - 15 */
    background: linear-gradient(#ffc000, #c59e29); /* 标准的语法 */
}

 

posted @ 2019-06-29 16:06  怪咖咖  阅读(2193)  评论(0编辑  收藏  举报