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>

The code must provide 'draggable div' using 'jquery ui', but my div is not draggable. Can someone find the reason?

Deadpool
  • 7,811
  • 9
  • 44
  • 88

3 Answers3

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

Working Demo

$(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>
Rino Raj
  • 6,264
  • 2
  • 27
  • 42
0

I have test your code into Chrome , it worked fine for me. I suggest you to visit jquery UI examples(https://jqueryui.com/draggable/)

rnogal
  • 51
  • 2