jQuery UI 拖动(Draggable) - 还原位置
当带有布尔值revert选项的draggable停止拖拽时,返回draggable(或它的助手)到原始位置
<!DOCTYPEhtml><html><head><metacharset="utf-8"><metahttp-equiv="X-UA-Compatible"content="IE=edge"><title>jQueryUI拖动(Draggable)-还原位置</title><linkrel="stylesheet"href="js/jquery-ui-1.12.1.custom/jquery-ui-1.12.1.custom/jquery-ui.min.css"><style>#draggable1,#draggable2{width:200px;height:200px;padding:0.5em;float:left;margin:010px10px0;}#draggablep{cursor:move;}</style></head><body><divid="draggable1"class="ui-widget-content"><p>还原</p></div><divid="draggable2"class="ui-widget-content"><p>还原助手</p></div><scriptsrc="js/jquery-ui-1.12.1.custom/jquery-ui-1.12.1.custom/external/jquery/jquery.js"type="text/javascript"></script><scriptsrc="js/jquery-ui-1.12.1.custom/jquery-ui-1.12.1.custom/jquery-ui.min.js"></script><script>$(function(){$("#draggable1").draggable({revert:true});$("#draggable2").draggable({revert:true,helper:'clone'});});</script></body></html>
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。