jBox 是一款基于 jQuery 的多功能对话框插件,可以实现网站的总体风格效果,给用户一个新的视觉享受。 css
基本用法:html
具体使用能够参考:http://www.5imvc.com/scripts/jbox/jbox-demo.htmlmvc
遇到的几个问题网站
1.子窗体往父页面传值插件
父页面:orm
$.jBox.open("iframe:${ctx}/task/testTaskInfo/menuForm?formTypes="+formTypes+"&testTaskId="+testTaskId, "试验项目",810,$(top.document).height()-240,{ buttons:{"清除":"clear", "关闭":true},id:"xxxx", showScrolling:false,bottomText:"试验项目选择",submit:function(v, h, f){ if (v=="clear"){ h.find("iframe")[0].contentWindow.clearContent(); return false; } }, loaded:function(h){ $(".jbox-content", top.document).css("overflow-y","hidden"); },closed:function () { } });
子页面:htm
parent.$("#testTaskId").val("xxx");//给父页面id为testTaskId的input标签赋值 parent.$("#iFrame").contents().find("#testTaskId").val("xx");//给父页面iframe引入的页面里的元素赋值 setTimeout(function(){ parent.$.jBox.close(true);//刷新父页面 },1000);
2.获取Jbox框里面元素的值对象
var boxNew = $.jBox.getBox();//获取最前面打开的窗口jQuery对象。 var fileVal=boxNew.find("#uploadFile").val();//获取jbox窗体里面的元素
三、模式窗体带返回值,在调用 $.jBox("iframe……, {}中加上 closed: function () {这里写获得返回值后须要执行的功能代码 }ip