I'm trying to use Sortable to reorder the items of a list. I've got a handle for each item of the list, which has :hover
and :active
css cursor settings, so that the cursor changes when the user mouses over the handles (and again when dragging).
<html>
<head>
<style>
span { width: 20px; background: red }
span:hover { cursor: -moz-grab; }
span:active { cursor: -moz-grabbing; }
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
<script>
$(function(){
$('#sortable').sortable({ handle: 'span' });
$('#sortable span').disableSelection();
});
</script>
</head>
<body>
<ul id="sortable">
<li><span>grab 0 here</span> I'm 0!</li>
<li><span>grab 1 here</span> I'm 1!</li>
<li><span>grab 2 here</span> I'm 2!</li>
<li><span>grab 3 here</span> I'm 3!</li>
<li><span>grab 4 here</span> I'm 4!</li>
<li><span>grab 5 here</span> I'm 5!</li>
<li><span>grab 6 here</span> I'm 6!</li>
<li><span>grab 7 here</span> I'm 7!</li>
</ul>
</body>
</html>
The problem is that the :active
cursor stops working. I'm not sure why, it works when I don't use sortable
, but afterwards, when I pop it up in firebug, I can see that the :hover
cursor is being applied, but no shift to :active
.
(for simplicity, I'm using -moz-grab
and -moz-grabbing
in my above example, which don't work in all browsers).
Any ideas what might be going wrong?