Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要将'sortstop'事件绑定到li树中的项目,而不是ol..这可能吗?
li
ol
您可以在 上绑定一个事件li,并通过执行以下操作来触发它:
$('li').on( 'sortstop', function( e, ui ) { // Do stuff } ); $('ol').sortable( { stop: function( e, ui ){ ui.item.trigger( e.type, ui ); } } );