属性document.body.clientHeight并document.body.clientWidth在IE7,IE8和Firefox上返回不同的值:
IE 8:
document.body.clientHeight : 704
document.body.clientWidth : 1148
Run Code Online (Sandbox Code Playgroud)
IE 7:
document.body.clientHeight : 704
document.body.clientWidth : 1132
Run Code Online (Sandbox Code Playgroud)
火狐:
document.body.clientHeight : 620
document.body.clientWidth : 1152
Run Code Online (Sandbox Code Playgroud)
为什么存在这种差异?
在不使用jQuery的情况下,是否存在在不同浏览器(IE8,IE7,Firefox)中保持一致的等效属性?
javascript css firefox internet-explorer-8 internet-explorer-7
请帮帮我.我需要使用百分比宽度创建布局.我有一个100%宽度的包装.
现在我有一个DIV(主要包装..我想保持94%的宽度百分比.. 100%身体的94%)..好的好
所以要做到这一点很简单.
- > BODY 100%宽度设定
- >容器94%宽度
--->第一个孩子DIV 70%向左浮动(70%的CONTAINER)
--->第二个孩子DIV 30%向右浮动(容器的30%)
但是我在FIRST CHILD DIV下有2个相同的列
-----> 50%和50%的宽度
错误是:在ie7 ..最后一列显示在底部..它没有正确浮动..如果我将宽度减少到29.9%!它的工作原理..我认为ie7在处理百分比宽度或某事时有错误.请澄清一下.我希望你得到这个问题,因为css/html太长了..我只是希望它是一个常见的问题.. :(
这是这个DIV的CSS ..希望有帮助:)
body {
width: 100%;
background: #fff;
text-align: center;
font-size: 12px;
}
#wide-primary {
background: #fff url(img/shadow1.png) repeat-x top;
position: relative;
top: -1px;
}
#primary {
width: 94%;
margin: 0 auto 0 auto;
text-align: left;
}
#features {
float: left;
width: 70%;
padding: 2% 0 0 0;
}
.featurebox {
float: left;
width: 48%;
padding: 0 2% …Run Code Online (Sandbox Code Playgroud) 这个SSCCE说明了一切:
<!doctype html>
<html lang="en">
<head>
<title>Test</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#add').click(function() {
var ul = $('#ul');
var liclone = ul.find('li:last').clone(true);
var input = liclone.find('input');
input.attr('name', input.attr('name').replace(/(foo\[)(\d+)(\])/, function(f, p1, p2, p3) {
return p1 + (parseInt(p2) + 1) + p3;
}));
liclone.appendTo(ul);
$('#showsource').text(ul.html());
});
});
</script>
</head>
<body>
<ul id="ul">
<li><input type="text" name="foo[0]"></li>
</ul>
<button id="add">Add</button>
<pre id="showsource"></pre>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
Copy'n'paste'n'run它,点击Add几次按钮.在每次点击时,您都应该看到<ul>要显示的HTML代码,<pre id="showsource">预期代码大致应该是:
<li><input name="foo[0]" type="text"></li>
<li><input name="foo[1]" type="text"></li>
<li><input …Run Code Online (Sandbox Code Playgroud) 停止运行此脚本?
此页面上的脚本导致Internet Explorer运行缓慢.如果它继续运行,您的计算机可能会无响应.
我确信我们都已经从IE7(或IE7模式下的IE8)中看到了这个有用且信息丰富的错误消息.删除此消息我需要一些帮助.
所以,对于我的工作,我需要让我们的网站在IE7中运行.显然,我们的一些客户无法升级或使用其他浏览器(公司法规或其他内容).
无论如何,有问题的页面包含选项卡(使用jQueryUI).页面加载后,jQuery使用AJAX加载每个选项卡的数据; 使用队列逐个加载选项卡.在每个选项卡中,都有"小部件",其中包含HTML和JavaScript(对于每个选项卡加载,都有各种脚本标记).
我在加载选项卡时遇到"慢速脚本"错误.我知道当脚本没有将控制权返回给浏览器时,IE会讨厌.所以,我想知道是否有办法'返回控制'或以某种方式睡觉,所以IE可以'重置'它的慢速脚本计数器.
它在chrome,firefox和IE8中运行良好.但在IE7上出现错误.这是我的jquery onchange事件.
$('select#NationId').change(function () {
var nationId = $(this).val();
$.ajax({
url: 'LoadAreas',
type: 'POST',
data: JSON.stringify({ nationId: nationId }),
dataType: 'json',
contentType: 'application/json',
success: function (data) {
$('select#AreaId').get(0).options.length = 0;
$('select#AreaId').append('<option value="0">Select All</option>');
$.each(data, function (val, Areas) {
$('select#AreaId').append('<option value="' + Areas.Id + '">' + Areas.Name + '</option>');
});
}
});
});
Run Code Online (Sandbox Code Playgroud)
调节器
[HttpPost]
public ActionResult LoadAreas(int nationId)
{
var _Areas = (from c in SessionHandler.CurrentContext.ChannelGroups
join cgt in SessionHandler.CurrentContext.ChannelGroupTypes on c.ChannelGroupTypeId equals cgt.ChannelGroupTypeId
where cgt.Name == "Area" && c.ParentChannelGroupId …Run Code Online (Sandbox Code Playgroud) 我一直坚持浮动问题一段时间,所以我希望社区可以再次帮助我.我在这里有一个新的网络表单.像往常一样,除了IE7(或IE8的兼容性)外,它看起来都很好.
由于某些原因,某些容器最终会在表单文本下方的新行上以表单字段结束.CSS不是我的强项,否则我能够解决这个问题我肯定.谁能告诉我这里缺少什么?
我尝试将float:left添加到表单文本中,但结果却是另一个混乱.
点击时有按钮和链接的边框.


任何人都可以帮我解决方案来删除它.
在我的网站上,IE7似乎忽略了某些CSS属性选择器.奇怪的是,只有当页面来自生产服务器时才会发生.如果我的个人服务器上有完全相同的代码,或保存在我的硬盘上,它可以正常工作.以下是导致问题的示例:
<!DOCTYPE HTML>
<html><head>
<title>IE display test</title>
<style type="text/css">
[type=button] {
display: block;
}
</style>
</head>
<body>
<input type="button" value="Button 1"/>
<input type="button" value="Button 2"/>
<input type="button" value="Button 3"/>
</body></html>
Run Code Online (Sandbox Code Playgroud)
由于按钮上的显示设置为"阻止",因此它们应垂直排列.但只有当我的生产服务器提供页面时,它们才会水平排列.当我使用开发人员工具栏检查样式时,我没有像往常一样看到"显示"属性.我唯一能想到的可能是这会导致页面的URL或来自服务器的响应头.我可以通过实验来弄清楚,但这样做会很不方便和耗时,所以在我这样做之前,我想问:为什么会发生这种情况以及可以做些什么呢?
编辑:我想出了一个小提琴.它在该网站上看起来很好.
编辑2:以下是来自生产服务器的响应标头:
HTTP/1.1 200 OK
服务器:Apache-Coyote/1.1
内容类型:text/html; charset = utf-8
内容 - 语言:en-US
内容长度:291
日期:星期三,2012年1月18日21:32:48 GMT
编辑3:以下是我个人服务器的响应标题:
HTTP/1.1 200 OK
日期:星期三,2012年1月18日21:37:30 GMT
服务器:Apache
变化:接受编码
内容编码:gzip
内容长度:176
保持活动:超时= 2,最大= 100
连接:保持-Alive
Content-Type:text/html; charset = utf-8
生产服务器不应用gzip压缩,因为它只对大于特定大小的文件执行此操作.如果我添加一些东西来使文件足够大,它使用gzip,我仍然在IE7中看到问题,所以这似乎与gzip没有任何关系.
我尝试配置我的个人服务器以发送"内容 - 语言"标题,如生产服务器,并没有触发问题.
我不知道是否有任何其他标题与此有关.我可以尝试测试它们,但它会有点棘手,所以可能需要一些时间. …
html css internet-explorer css-selectors internet-explorer-7
我在本教程后面的应用程序中实现了Routing
http://docs.angularjs.org/tutorial/step_07
我无法让我的版本在IE7中工作,并且花了一段时间试图弄清楚我错过了什么/做错了我注意到这个例子不起作用.
http://angular.github.com/angular-phonecat/step-7/app/
任何人都知道如何让这个工作?
HTML:
<ul>
<li>
<div class="one">Variable Height Title</div>
<div class="two">Fixed height middle block</div>
<div class="three">Variable height middle block<br />more content<br /> more contentmore content<br /> more content<br /> more content</div>
<div class="four">Fixed height footer</div>
</li>
<li>
<div class="one">Variable Height Title Might be two lines long</div>
<div class="two">Fixed height middle block</div>
<div class="three">Variable height middle block</div>
<div class="four">Fixed height footer</div>
</li>
<li>
<div class="one">Variable Height Title</div>
<div class="two">Fixed height middle block</div>
<div class="three">Variable height middle block</div>
<div class="four">Fixed height footer</div>
</li>
</ul> …Run Code Online (Sandbox Code Playgroud)