现遇到一问题 :对话框怎么能根据 要显示的内容,自动改变大小。对话框内放的内容有好多隐藏的div,通过链接可以展开隐藏的div,结果,内容显示不全。请大家帮忙,在线等。。
解决方案 »
- Ext radiogroup 动态加载数据问题
- 一个页面跳转的问题
- 关于js调用内部函数,并返回值(附代码)
- 有没有网页上用的 ListView ?能大图标、小图标、列表、详细等视图显示的
- 求救!在线等,关于密码验证
- JavaScript 层随着鼠标望下移动,现在想不动,解决了全分相送!
- 小小问题,怎样实现选中下拉框的哪一行??
- 请教document.clear()的用法
- visual studio 2013 调试 nodejs 问题, debugger listening on port 5858
- 请问 各位大神 怎样将 json 存入数组?
- 如何编写批量效果的代码,急用!
- 子页面向父页传值,找不到此函数
{
url = "DemoFiles/Lookword_message.html";
var left = screen.width/2 - 910/2;
var top = screen.height/2 - 330/2;
window.open(url,'dialog','modal=0,left=' + left + ',top=' + top + ',height=340,width=910,resizable=0,status=0,scrollbars=0');
}
如果正常情况下就没有任何问题
非正常的情况就是在变化大小的过程中移动窗体,会报拒绝访问的错误
http://topic.csdn.net/u/20100330/13/10bf50ed-bbe7-4eab-9ffa-a0675536be45.html?44720
你试过这个方法么
var TopPosition,LeftPosition;
function sizeDialog()
{
dialogHeight = (parseInt(window.layout.offsetHeight) + 30) + "px";
dialogWidth = (parseInt(window.layout.offsetWidth) + 10) + "px";
window.setTimeout(centerDialog,1);
} function centerDialog()
{
TopPosition = (screen.height) ? (screen.height-parseInt(dialogHeight))/2 : 0;
LeftPosition = (screen.width) ? (screen.width-parseInt(dialogWidth))/2 : 0;
}
var appletWidth = 0;
var appletHeight = 0;
var x = 0;
var y = 0;function sett()
{
var curApplet;
var appletWidthnow = 0;
var appletHeightnow = 0;
try
{
curApplet = document.KVMAPPLET[1];
if ('function' != typeof curApplet)
{
curApplet = document.KVMAPPLET;
}
}
catch(e)
{
}
appletWidthnow = curApplet.getPreferredSize().getWidth();
appletHeightnow = curApplet.getPreferredSize().getHeight();
if ((appletWidthnow == appletWidth) && (appletHeightnow == appletHeight))
{
return;
}
appletWidth = appletWidthnow;
appletHeight = appletHeightnow;
x = (window.screen.width - appletWidth) / 2;
y = (window.screen.height - appletHeight) / 2;
if(x<0||y<0)
{
x = 0;
y = 0;
}
self.moveTo(x, y);
self.resizeTo(appletWidth+20,appletHeight+125);
}
setInterval("sett();", 1000);
</script>
self.resizeTo(appletWidth+20,appletHeight+125);处加上try{}catch(e){}就行了
在条件判断中修改成 if ((appletWidthnow == appletWidth) && (appletHeightnow == appletHeight))
{
webWidth=document.body.offsetWidth-14;
webHeight=document.body.offsetHeight-93;
if((appletWidthnow>webWidth-10)&&(appletWidthnow<webWidth+10)&& (appletHeightnow>webHeight-10)&&(appletHeightnow<webHeight+10))
{
return;
}
}
我的自适应就OK了