【问题标题】:Negative bottom margin not working in IE负底部边距在 IE 中不起作用
【发布时间】:2012-09-12 04:53:07
【问题描述】:

我有一个隐藏的 div:

 position:fixed; 
 bottom:-240px; 

*更新 II *

将底部从底部加倍:-240px 到 -480px 再调整动画高度,在 IE9 中隐藏了 div 并消除了 Chrome 和 Safari 中的闪烁。溢出:隐藏在 IE9 中由于某种原因无法正常工作,我无法通过单击关闭按钮 (mediaclose) 在 IE9 中关闭 div。*

我使用 jquery animate 来显示 div,点击链接时访问它:

 $("#media").click(function () {
 $("#mediadetails").animate({height: "425px"}, 1000);

还要隐藏它:

 $('#mediaclose').click(function() {
 $('#mediadetails').animate({height: "0px"}, 2000);

【问题讨论】:

  • 你说IE能用,你说IE不能用,是什么?
  • 对不起,我的意思是它在 Firefox 中可以正常工作
  • 您是否在寻找类似的内容:jsfiddle.net/bhrj8(单击任意位置以切换 div)。
  • 类似,是的。但是我在 div 的右上角有一个关闭按钮 (#mediaclose),用于关闭 div,在页面右上角有一个链接用于打开它。我无法在 IE 中关闭 div,但所有其他浏览器都很好
  • 如果您告诉我们您遇到问题的 IE 版本也可能会有所帮助。

标签: javascript jquery internet-explorer google-chrome jquery-animate


【解决方案1】:

试试:

$('#mediadetails').animate({height: 0}, 2000);
$('#mediadetails').animate({height: 425}, 2000);

【讨论】:

  • 你的意思是用第一部分作为开​​盘,第二部分作为收盘?
  • @user1667057 关闭时不要使用第一部分,打开时不要使用第二部分
猜你喜欢
  • 2018-06-22
  • 2012-09-20
  • 2013-08-22
  • 1970-01-01
  • 1970-01-01
  • 2011-07-29
  • 1970-01-01
  • 2015-02-19
相关资源
最近更新 更多