Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
IE8 Jquery show()div增加父div的大小_Jquery_Css_Internet Explorer 8 - Fatal编程技术网

IE8 Jquery show()div增加父div的大小

IE8 Jquery show()div增加父div的大小,jquery,css,internet-explorer-8,Jquery,Css,Internet Explorer 8,我有一个这样的Jquery弹出窗口 $("[id=messagelink]").hover(function(e) { $(this).next('#popupmessage').show(); }, function() { $(this).next('#popupmessage').hide(); }); div代码: <div>...... <a href='' id='messagelink' name='messagelink' touserid='

我有一个这样的Jquery弹出窗口

$("[id=messagelink]").hover(function(e) {
    $(this).next('#popupmessage').show();
}, function() {
    $(this).next('#popupmessage').hide();
});
div代码:

<div>......
<a href='' id='messagelink' name='messagelink' touserid='1' ><img src='images/icons/mail.png' width='15' height='15' /></a>
<div id='popupmessage' class='popup'>Blaaah</div>";
......
</div>
在FF、Chrome、Opera中都可以正常工作,但在IE中会显示弹出窗口,但它会增加父DIV的高度和宽度。 更糟糕的是,它通过溢出向DIV添加水平和垂直滚动条。哎呀

我删除了CSS中的填充,然后问题就解决了。但我需要一个不错的弹出消息,而不是一个裁剪

可以做些什么

谢谢你的帮助。
Coenos

如果您的目标不是IE7或更低,那么可以使用div{box size:border box;}。您所提供的任何填充都将填充在指定的DIV高度和宽度的“内部”,而不是外部。

尝试使DIV位置相对。我自己从来没有经历过

div {
    position: relative;
}

我检查了IE8的模拟器,你可以检查真正的IE8,看看它是否工作

div {
    position: relative;
}