我在div中有一些文本我想要在图像的右侧显示。我希望文本环绕图像并在页面到达图像的末尾时与页面的左侧对齐。 div的可见性使用一个小小的jQuery脚本来切换。问题在于,当可见性切换时,文本在到达图像底部后不再扩展到页面的左边缘 - 而是继续,就好像图像是左边距一样。在html基本上是这样的:jquery切换中断float in ie
<html>
<image float:left>
<div id="toggleMe">lots of text here</div>
</html>
注意这两件事情:这个问题不会在Firefox发生,只有IE(未经测试与其他浏览器)。另外,如果图像的可见性未被切换,它在IE中可以正常工作。
下面是代码:
<script type="text/javascript">
$(loadStuff);
function loadStuff() {
$("#divWorkExperience").hide();
$("#btnShowWorkExp").click(function() {
$("#divWorkExperience").toggle("slow");
return false;
});
剪断
<div style="text-align:justify;">
<img src="ContentImages/highres_22409206.jpg" style="height:300px;width:400px;float:left;clear:none; margin-right:6px;" alt="me" />
<div id="divWorkExperience" style="display:block; clear:none;">lots of text</div>
</div>
想要设置一个小提琴吗? http://jsfiddle.net – VIDesignz
尝试将此样式添加到您的图片 position:absolute; – Idiot211