为什么anchor: '96.7%', 在火狐中管用,在IE下不起作用那!!!

jnkaixin2009 2011-06-24 09:58:57
如题,由于文字内容太多,我想固定控件的宽度,然后让控件的高度为'96.7%,超过时,出现下拉条。
代码如下:
{
xtype: 'displayfield',
name: 'info.content',
value:this.content,
anchor: '96.7%',
height: 200
}

在火狐中,是有下拉条的,但是在IE下却没有、同一条记录、这是为什么啊,谁能告诉我啊???在线等。谢过了,先。
...全文
74 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
jnkaixin2009 2011-06-24
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 aspwebchh 的回复:]
可以了,谢了,是我的引用写错了,谢过
jnkaixin2009 2011-06-24
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 aspwebchh 的回复:]
JScript code

function getScreenSize = function()
{
var theWidth,theHeight;
if (window.innerWidth)
{
theWidth = window.innerWidth
theHeight = window.innerHeight ……
[/Quote]


大哥,我用你的建议试过了,怎么还是不行那。
代码如下:
{ xtype: 'displayfield',
name: 'info.content',
value:this.content,
//anchor: '96.7%',
renderer:getScreenSize
//height: 200
}


getScreenSize : function()
{
var theWidth,theHeight;
if (window.innerWidth)
{
theWidth = window.innerWidth;
theHeight = window.innerHeight;
}
else if (document.compatMode=='CSS1Compat')
{
theWidth = document.documentElement.clientWidth;
theHeight = document.documentElement.clientHeight;
}
else if (document.body)
{
theWidth = document.body.clientWidth;
theHeight = document.body.clientHeight;
}
var result = [theWidth,theHeight];
return result;
}
jnkaixin2009 2011-06-24
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 kyzy_yy_pm 的回复:]
anchor是什么作用?用其他的代替不行吗?
[/Quote]

其实我就是想实现这样的功能, 预览页面中的内容正文太多,我要给这一列加上下拉条。不至于文字太多,展示不开。
kyzy_yy_pm 2011-06-24
  • 打赏
  • 举报
回复
anchor是什么作用?用其他的代替不行吗?
挨踢直男 2011-06-24
  • 打赏
  • 举报
回复
function getScreenSize = function()
{
var theWidth,theHeight;
if (window.innerWidth)
{
theWidth = window.innerWidth
theHeight = window.innerHeight
}
else if (document.compatMode=='CSS1Compat')
{
theWidth = document.documentElement.clientWidth
theHeight = document.documentElement.clientHeight
}
else if (document.body)
{
theWidth = document.body.clientWidth
theHeight = document.body.clientHeight
}
var result = [theWidth,theHeight];
return result;
}

用这个函数获得浏览器窗口高宽,兼容性好
jnkaixin2009 2011-06-24
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 kyzy_yy_pm 的回复:]
两个浏览器不不兼容的地方有很多,就算兼容但是效果不同意不罕见,这个没啥
[/Quote]


问题是,我用火狐做的,测试通过,测试人员用的是IE浏览器,给我提出BUG了,就这个问题,我怎样解决啊
kyzy_yy_pm 2011-06-24
  • 打赏
  • 举报
回复
两个浏览器不不兼容的地方有很多,就算兼容但是效果不同意不罕见,这个没啥

87,914

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧