jquery的Layer彈出框操作


在layer中,我們要先獲取窗口的索引,然后再進行操作。
var index = parent.layer.getFrameIndex(window.name); //獲取窗口索引

$("#update_id").click(function() { parent.$('#father_id').html(autoSelectName);//對父頁面的元件操作,給id為father_id進行賦值。 window.parent.location.reload(); //刷新父頁面 parent.layer.close(index); });

 

 

openUser是一個js方法,selectId,selectName是傳的參數,里面調用layer的open方法,area是彈出框的大小,content是請求頁面路徑。
還要導入layer的js包,在layer的官網上可以下載,加載layer.js就行,注意,這個好像要求jquery的版本是1.8以上才行。
function
openUser(selectId,selectName){ layer.open({ type: 2, title: '選擇關聯人', maxmin: true, area: ['1000px', '600px'], content: '${base}/user/listLayout?selectId='+selectId+'&selectName='+selectName, scrollbar: false, end: function(){ } }); }


在layer的官網有很全的例子供大家學習,我覺得這個功能比較強大,當然如果要弄彈出層,也可以采用bootsrap的靜態框。
layer的官網:http://layer.layui.com/

 


免責聲明!

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



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