DROP Event Not firing
DROP Event Not firing in First and Last Position
I am using a UL where its LI are draggable and sortable. If i drag and drop the item in the middle then the drop event fires, but if i drop in the first or last position of the UL then the drop event is not firing. Thanks in advance.
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
<link rel="stylesheet" href="Styles/themes/base/jquer开发者_运维技巧y.ui.all.css">
<script src="Scripts/jquery-1.6.2.js"></script>
<script src="Scripts/ui/jquery.ui.core.js"></script>
<script src="Scripts/ui/jquery.ui.widget.js"></script>
<script src="Scripts/ui/jquery.ui.accordion.js"></script>
<script src="Scripts/ui/jquery.ui.mouse.js" type="text/javascript"></script>
<script src="Scripts/ui/jquery.ui.draggable.js" type="text/javascript"></script>
<script src="Scripts/ui/jquery.ui.droppable.js" type="text/javascript"></script>
<script src="Scripts/ui/jquery.ui.sortable.js" type="text/javascript"></script>
<link href="Styles/whereabouts.css" rel="stylesheet" type="text/css" />
<script src="js/demos.js" type="text/javascript"></script>
<style>
#draggable { width: 16em; padding: 0 1em; }
#draggable ul li { margin: 1em 0; padding: 0.5em 0; } * html #draggable ul li { height: 1%; }
#draggable ul li span.ui-icon { float: left; }
#draggable ul li span.count { font-weight: bold; }
</style>
<script>
$(function () {
$(".ui-state-default").draggable();
$(".ui-helper-reset").droppable({
drop: function (event, ui) {
alert('dropped');
}
}).sortable();
});
</script>
</head>
<body>
<ul class="ui-helper-reset">
<li id="event-start" class="ui-state-default"><span class="ui-icon ui-icon-play"> </span>"start" invoked <span class="count">0</span>x</li>
<li id="event-drag" class="ui-state-default"><span class="ui-icon ui-icon-arrow-4"></span>"drag" invoked <span class="count">0</span>x</li>
<li id="event-stop" class="ui-state-default"><span class="ui-icon ui-icon-stop">
</span>"stop" invoked <span class="count">0</span>x</li>
</ul>
</body>
</html>
This may not the answer for the questions.
Actually i moved my drop event code to stop event code of the Sorttable() and my requirement is fulfilled in my real application. Thank you all.
精彩评论