在js中綁定方法
$(document).on("show.bs.modal", ".modal", function(){
$(this).draggable({
// handle: ".modal-header" // 只能點擊頭部拖動
});
$(this).css("overflow", "hidden"); // 防止出現滾動條,出現的話,你會把滾動條一起拖着走的
});
bootstrap modal 的events:
查了好久才查到:(
事件 | 描述 | 示例 |
---|---|---|
show.bs.modal | 在調用 show 方法后觸發。 | $("#identifier").on('show.bs.modal', function(){//do sth. }); |
show.bs.modal | 當模態框對用戶可見時觸發(將等待 CSS 過渡效果完成)。 | $("#identifier").on('shown.bs.modal', function(){//do sth. }); |
hide.bs.modal | 當調用 hide 方法時觸發。 | $("#identifier").on('hide.bs.modal', function(){//do sth. }); |
hidden.bs.modal | 當模態框完全對用戶隱藏時觸發。 | $("#identifier").on('hidden.bs.modal', function(){//do sth. }); |
詳細參考:http://www.runoob.com/bootstrap/bootstrap-modal-plugin.html
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系我们删除。