2015-04-09 3 views
0
<html> 
<head> 
<link rel="stylesheet" href="http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> 
<script src="http://code.jquery.com/jquery-1.10.2.js"></script> 
<script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script> 
<style> 
    div{width:100px;height:100px;background:yellow;} 
</style> 
<script> 
    $(document).ready(function(){ 
     $('div').draggable(); 
    }); 
</script> 
</head> 
<body> 
<div>Drag Me</div> 
</body> 
</html> 

Код должен содержать 'draggable div', используя 'jquery ui', но мой div не перетаскивается. Может ли кто-нибудь найти причину?Div draggable UI not workig

+0

использование $ (документ) .ready (функция() {InstEd от $ document.ready (функция() { – Saty

+0

Еще не работает братан .... изм. – Deadpool

+0

какая ошибка вы получаете? – Saty

ответ

0
<div id="draggable" class="ui-widget-content"> 
    Drag Me 
</div> 
<script> 
    $(document).ready(function(){ 
     $('#draggable').draggable(); 
    }); 
</script> 
0

Рабочая Демонстрационный

$(function() { 
 
    $('div').draggable(); 
 
});
div { 
 
    width: 100px; 
 
    height: 100px; 
 
    background: yellow; 
 
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> 
 

 
<script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script> 
 
<div>Drag Me</div>