
September 21st, 2012, 07:36 AM
|
|
Registered User
|
|
Join Date: Sep 2012
Posts: 2
Time spent in forums: 30 m 30 sec
Reputation Power: 0
|
|
|
jQuery - Draggable not working
I am trying to implement the draggable UI
I have the needed libraries:
<script type="text/javascript" src="js/jquery-1.7.2.js"></script>
<script src="js/jquery.ui.core.js"></script>
<script src="js/jquery.ui.widget.js"></script>
<script src="js/jquery.ui.mouse.js"></script>
<script src="js/jquery.ui.draggable.js"></script>
<script src="js/jquery.ui.sortable.js"></script>
And my markup:
Code:
$(function() {
$(".img-drop").click(function(){
//create a div on wall
$('<div></div>').attr({
id: 'frame1'
}).appendTo("#wall");
draggable('frame1')
});
});
function draggable(div) {
$(div).draggable({ containment: "#wall" });
}
The div is created, but it is not draggable.
|