通过自建iframe遮罩层解决flash位于window窗口之上的问题
来源:互联网 发布:parsley js 编辑:程序博客网 时间:2024/06/05 13:30
效果对于固定不动窗口或菜单则更有效,并不太适用于可移动的窗口,遮罩层与窗口位置很难一致。若是可移动的窗口建议用前面一篇文章所介绍的shim属性Ext自身提供的方法。
同样下面的方法只对IE有效,firefox下依然无效。
Ext.onReady(function() {
......
//创建垫片效果iframe遮罩层
function createShim(coordinate) {
closeShim();
var shimmer = document.createElement('iframe');
shimmer.id='shimmer';
shimmer.style.position='absolute';
shimmer.style.top=coordinate.top;
shimmer.style.left=coordinate.left;
shimmer.style.width=coordinate.width;
shimmer.style.height=coordinate.height;
shimmer.style.zIndex='999';
shimmer.setAttribute('frameborder','0');
// shimmer.setAttribute('src','javascript:false;');
document.body.appendChild(shimmer);
}
//移除iframe遮罩层
function closeShim(){
var shimmer = document.getElementById('shimmer')
if(shimmer){
document.body.removeChild(shimmer);
}
}
// 查询窗口对象变量
var searchWin;
// 查询按钮
function doSearch_pic_panel() {
searchWin = Ext.getCmp('search-window'); //避免出现显示两个窗口的问题
if (!searchWin) {
searchWin = new Ext.Window({
contentEL:'search-window',
title : '请输入查询条件',
layout : 'fit',
width : 400,
height : 300,
closeAction : 'hide',
plain : true,
floating:true,
shim:true,
items : searchFormPanel_pic_panel,
buttons : [{
text : '查询',
handler : function() {
searchWin.hide();
}
}, {
text : '关闭',
handler : function() {
searchWin.hide();
}
}]
});
searchWin.on("show",function(window){
var winEl = window;
var position =new Array();
position = winEl.getPosition(true);
createShim({
top:position[1],
left:position[0],
width:winEl.getFrameWidth()+winEl.getInnerWidth(),
height:winEl.getFrameHeight()+winEl.getInnerHeight()
});
});
searchWin.on("hide",function(window){
closeShim();
});
searchWin.on("beforemove",function(component,x,y){
closeShim();
});
searchWin.on("move",function(component,x,y){
closeShim();
var winEl = Ext.getCmp('search-window');
var position =new Array();
position = winEl.getPosition(true);
createShim({
top:y,
left:x,
width:winEl.getFrameWidth()+winEl.getInnerWidth(),
height:winEl.getFrameHeight()+winEl.getInnerHeight()
});
});
}
searchWin.show();
}
......
});
其实贴出来主要是学习这一种思想。网上也有关于该问题的讨论:
Why does moving the IFRAME shim slow things down?
链接地址:https://www.extjs.com/forum/showthread.php?1384-Why-does-moving-the-IFRAME-shim-slow-things-down
Iframe Shim解决applet挡住ExtJS工具栏菜单问题
链接地址:http://agile-boy.javaeye.com/blog/140935
[OPEN-884] Shim size problem on Ext.Window with shadow
链接地址:http://www.extjs.com/forum/showthread.php?97413-OPEN-884-Shim-size-problem-on-Ext.Window-with-shadow&p=459829#post459829
- 通过自建iframe遮罩层解决flash位于window窗口之上的问题
- 通过自建iframe遮罩层解决flash位于window窗口之上的问题
- 采用Window对象shim属性解决IE下flash位于弹出窗口之上遮住窗口问题——此方法对firefox暂未解决
- 采用Window对象shim属性解决IE下flash位于弹出窗口之上遮住窗口问题——此方法对firefox暂未解决
- 让Bootstrap3的菜单位于Iframe之上
- 漂浮广告位于网页flash之上
- 让swfobject.js 支持透明的flash,即让悬浮的div能够位于flash之上
- 完美解决MDI子窗口最大化后标题栏在父窗口菜单栏之上的问题
- 通过js或jQuery,<iframe>子父窗口之间元素、方法、window的相互获取
- 解决iframe作为子窗口,刷新后iframe页面跳转到其它页面的问题
- 浮动窗口在flash页面之上
- window.open弹出窗口时保证窗口位于屏幕的中央
- iframe,window,滚动条的一些问题
- 通过SourceTree连接SSL有问题的自建gitlab服务器
- 解决:由于代码已经过优化或者本机框架位于调用堆栈之上,无法计算表达式的值。
- 解决:由于代码已经过优化或者本机框架位于调用堆栈之上,无法计算表达式的值
- 总结JavaScript(Iframe、window.open、window.showModalDialog)父窗口与子窗口之间的操作
- 总结JavaScript(Iframe、window.open、window.showModalDialog)父窗口与子窗口之间的操作
- 异常:数据库没有有效所有者,因此无法安装数据库关系图支持对象
- 回归问题的解释
- jdbcTemplate.update(...)的用法
- OSD的主要实现方法和类型
- C#中的Thread类的Join()方法
- 通过自建iframe遮罩层解决flash位于window窗口之上的问题
- Binary Tree
- orale tablespace&datafile -- oracle表空间
- 外挂开始了
- 在这里祝愿灾区所有的人一切安好。bless
- 静态类static class
- 最近开始研究J2SE
- 图解Fat jar的使用(转自一路向北)
- 动态分配二维数组