i’m making some experiments with Jquery UI draggable, but currently my application is not working and i don’t understand why. Here’s the code:
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js"></script>
<script type="text/javascript">
$(".productItem").draggable({
helper: 'clone',
handle: "productItem"
});
$("#basket").droppable({
accept: ".productItem",
drop: function(event, ui){
$("<div></div>")
.html(ui.draggable.text())
.appendTo($(this));
}
});
</script>
</head>
<body>
<h2>Products</h2>
<div id="list">
<div class="productItem">product 1</div>
<div class="productItem">product 2</div>
<div class="productItem">product 3</div>
</div>
<hr/>
<h2>Basket</h2>
<div id="basket" style = "height: 100px; border: 1px solid red;">
</div>
</body>
</html>
This code is woring in JsFiddle, but i can’t seem to make it work in chrome, so i think it is because of the jQuery include. Can somebody help me?
Found the answer, the problem was i was using jQuery 1.8.0 which, didn’t support jQuery UI, i changed to jQuery 1.7.2 and now it is working perfectly.