jQuery UI draggable not working in chrome

2019-10-03 15:50发布

问题:

jQuery draggable not working in chrome

Code:

<script src="js/jquery-1.6.2.min.js" type="text/javascript"></script>
<script src="js/jquery-ui-1.8.16.custom.min.js" type="type/javascript"></script>
<script type="text/javascript">
$(function() {
    $( ".drag" ).draggable();
});
</script>

<div class="drag">draggable</div>

回答1:

JS FIDDLE Test Try this. In my browser dargging works correctly. Working in your browser? If not working, then you wrong plugged jqueryui library.

<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>

window.onload = function(){
    $( "#drag" ).draggable();
}


回答2:

It's simple, code is correct but Chrome extension adBlocker blocking draggable function. Just uninstall adBlocker and reset chrome.