i'm trying to make a popup to draggable. does anyone help me how to do that, here is my code
/
$(document).ready(function(){
function showAlertBox(){
$("#alert").css("display","inherit");
$("#content").addClass("back");
}
function removeAlertBox(){
$("#alert").css("display","none");
$("#content").removeClass("back");
}
$("#alertClose").click(function(){
removeAlertBox();
});
$("#alertShow").click(function(){
showAlertBox();
});
$( "#alert" ).draggable();
});
i'm trying to make a popup to draggable. does anyone help me how to do that, here is my code
http://jsfiddle/Ur5Xn/38/
$(document).ready(function(){
function showAlertBox(){
$("#alert").css("display","inherit");
$("#content").addClass("back");
}
function removeAlertBox(){
$("#alert").css("display","none");
$("#content").removeClass("back");
}
$("#alertClose").click(function(){
removeAlertBox();
});
$("#alertShow").click(function(){
showAlertBox();
});
$( "#alert" ).draggable();
});
Share
Improve this question
asked Oct 25, 2013 at 7:36
XaviXavi
2,5947 gold badges43 silver badges59 bronze badges
2
-
9
Your code works fine, you just forgot to include jquery-ui, which is where
draggable
es from. – orhanhenrik Commented Oct 25, 2013 at 7:38 -
Izzey is onto it, just include
jquery-ui
plugin – gwillie Commented Oct 25, 2013 at 7:41
4 Answers
Reset to default 2You did not load Jquery UI in your fiddle. It works fine.
Just turn on JQuery Ui. You can try enabling it in JSfiddle, on the right top corner and see that your code works.
your code is working good kindly include plugin script after the jquery plugin.. it will sureky work..
Just try to check "jQuery UI 1.10.3" (top left of the page) in your JSfiddle, it works with me.