跨框架的遮罩层(jquery)
来源:互联网 发布:ug哪个版本编程最好用 编辑:程序博客网 时间:2024/05/23 19:15
function CreatNode(w, h, s) { //参数w为弹出页面的宽度,参数h为弹出页面的高度,参数s为弹出页面的路径 var NewMask = window.parent.document.createElement_x("div"); NewMask.id = "Mask"; NewMask.style.position = "absolute"; NewMask.style.top = "0"; NewMask.style.left = "0"; NewMask.style.zIndex = "9"; NewMask.style.backgroundColor = "#000"; NewMask.style.filter = "alpha(opacity=70)"; NewMask.style.opacity = "0.7"; NewMask.style.width = "100%"; NewMask.style.height = (window.parent.document.body.scrollHeight + 50) + "px"; var NewDiv = window.parent.document.createElement_x("div"); NewDiv.id = "newdiv"; NewDiv.style.width = w; NewDiv.style.height = h; NewDiv.style.position = "absolute"; NewDiv.style.top = (window.screen.height - 450) / 4 + "px" NewDiv.style.left = (window.screen.width - 910) / 2 + "px"; NewDiv.style.zIndex = "99"; ; var NewFrame = window.parent.document.createElement_x("iframe"); NewFrame.id = "frame" NewFrame.setAttribute("frameBorder", "0"); NewFrame.setAttribute("scrolling", "no"); NewFrame.setAttribute("allowTransparency", "true"); NewFrame.setAttribute("width", w); NewFrame.setAttribute("height", h); NewFrame.setAttribute("src", s); var NewImg = window.parent.document.createElement_x("img"); NewImg.id = "newimg" NewImg.style.cursor = "pointer"; NewImg.style.position = "relative"; NewImg.style.top = "-479px"; NewImg.style.left = "880px"; NewImg.onclick = function() { Cancel(); } NewImg.setAttribute("src", "images/del.png") NewImg.setAttribute("title", "点击关闭") $("body", window.parent.document).append(NewMask); //这里用了jquery的添加节点方式,如果没有jquery文件可改成window.parent.document.body.appendChild(NewMask); $("body", window.parent.document).append(NewDiv); $("#newdiv", window.parent.document).append(NewFrame); $("#newdiv", window.parent.document).append(NewImg);}//移除添加的节点function Cancel() { window.parent.document.body.removeChild(window.parent.document.getElementByIdx_x("Mask")); window.parent.document.body.removeChild(window.parent.document.getElementByIdx_x("newdiv"));}
以下代码收集于网络,大家做的时候可以自己修改!
- 跨框架的遮罩层(jquery)
- jquery的validate框架
- jquery组件的框架
- 基于JQuery框架的AJAX
- 基于JQuery框架的AJAX
- AJAX 框架Jquery的使用方法
- jQuery UI的CSS框架
- 实现简单的jquery框架
- 对jquery框架的理解
- JQuery框架的AJAX实例
- 开发自己的JQuery框架
- jQuery插件的实现框架
- JQuery 跨框架(iframe)操作
- Jquery框架
- JQuery框架
- jQuery框架
- jQuery框架
- jQuery框架
- jquery 取消链接虚线
- POJ 1419 Graph Coloring
- GUI 剖析之 4)我想写动画程序
- 十二周上机项目3:四数的最大公约数
- vim削除の腕前
- 跨框架的遮罩层(jquery)
- 堆栈-直接-计算中缀算式表达式
- 11-16明天要回家了,今天上午的代码子发出来吧!
- JS产生随机数的几个用法!
- c#将文字转成图片(防止采集)
- 让ListView完全透明
- 文本输入框input背景的兼容性解决
- 串口通讯不正常
- 火狐浏览器中Div为空时height,width不起作用