如何在Bower中使用jQuery draggable?

时间:2016-07-12 09:16:36

标签: javascript jquery jquery-ui bower

我用bower安装了jquery-ui-draggable,但它不起作用。物品不可拖动。

<head>
    <link rel="stylesheet" href="bower_components/jquery-ui/themes/smoothness/jquery-ui.min.css">
    <script src="bower_components/jquery/dist/jquery.min.js"></script>
    <script src="bower_components/jquery-ui/jquery-ui.min.js"></script>
    <script src="bower_components/jquery-ui-draggable/dist/jquery-ui-draggable.min.js"></script>
    <script src="script.js"></script>
</head>
<body>
    <h2>Draggable Test</h2>
    <br>
    <button id="dragbtn">Drag me</button>
</body>

的script.js

$(function(){
    $(document).ready(function(){
        $('#dragbtn').draggable();
    });
})

1 个答案:

答案 0 :(得分:0)

试试这个

$( "#dragbtn" ).draggable({
        cancel: false
    });