How can I change CSS property once sorted. Something likes this:
$( "#sort" ).sortable({
$(#div1).css("background-color","yellow");
});
Thanks alot
How can I change CSS property once sorted. Something likes this:
$( "#sort" ).sortable({
$(#div1).css("background-color","yellow");
});
Thanks alot
Share Improve this question asked Aug 5, 2011 at 14:52 jQuerybeastjQuerybeast 14.5k39 gold badges120 silver badges198 bronze badges 1- Can you be more specific? Are you trying to style them to show which one was sorted? – Joe Flynn Commented Aug 5, 2011 at 14:55
3 Answers
Reset to default 6When you call initiate the plugin, make sure you pass a handler for the stop event:
$('#sort').sortable({
stop: function(){
$('#div1').css('background-color','yellow');
}
});
http://docs.jquery./UI/Sortable#events
$( ".selector" ).sortable({
update: function(event, ui) { ... }
});
Look at the events for sortable on the jQuery UI website: http://jqueryui./demos/sortable/#events
Depending on the event you want, you can use:
$( "#sort" ).sortable({
change: function(){
$("#div1").css("background-color","yellow");
}
});
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744989657a4604825.html
评论列表(0条)