bootstrap的modal彈窗,在多層窗口關閉時只會關閉自窗口,不再關閉父窗口


bootstrap多層modal彈窗時。當子窗口關閉時,所有父窗口一起關閉。

原因是bootstrap在窗口關閉事件委托時,委托給所有窗口。

如源碼:

this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))

改進為:
this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]:first', $.proxy(this.hide, this))  
this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]:last', $.proxy(this.hide, this))  

 

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM