javascript - jquery animate 删除 IE 中 div 中的滚动

标签 javascript jquery internet-explorer

现在,当我使用 jQuery 的 animate() 时,我遇到了这个奇怪的问题。 <div> 上的函数它消除了滚动的能力。我正在用 animate() 调整高度。此问题仅在 IE 中出现,在 Chrome 和 FF 中正常。

下面是我的 div 的 css 类

div.fullscroll{

  height: 65%;
  width: 75%;
  overflow-x: hidden;
  overflow-y: scroll;
  border-top: 1px solid #347235;
  border-bottom: 2px solid #347235;
  border-right: 2px solid #347235;
  border-left: 2px solid #347235;
  -moz-border-radius-topleft:     .1em;
  -moz-border-radius-topright:    .1em;
  -moz-border-radius-bottomright: .2em;
  -moz-border-radius-bottomleft:  .2em;
  border-top-left-radius: .1em;
  border-top-right-radius: .1em;
  border-bottom-right-radius: .2em;
  border-bottom-left-radius: .2em;
  background-color: #FFF;
  padding: 0px;
  margin: 0px auto;
  position:relative;
}

这是我的 JS Jquery 动画,其中 <div id='main'>

$('#main').animate({
            height: "40%"
          }
          ,"slow");

动画完成后 <div>标签不再具有滚动功能。我完全被这个问题难住了,想知道是否有人有想法。

(这又只发生在 IE 中)

最佳答案

我猜测这可能是 IE 设置百分比高度的问题 ( ref )。尝试将高度更改为像素值,看看是否有效。

另外,#main.fullscroll 是同一个 div 吗?

关于javascript - jquery animate 删除 IE 中 div 中的滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3965135/

相关文章:

javascript - 如何将数据从 Angular 2 中的多个组件传递到单个 @Input?

html - Internet Explorer 中的响应式设计

javascript - 为包目录外的文件启用 nyc/istanbul 代码覆盖

JQuery 和 <div> 向左滑动

javascript - 使用 jQuery 读取 div 内容会跳过 HTML、head 和 body 标签

javascript - 我可以在 jQuery 中的 "this"之后添加更多吗?

internet-explorer - 在父元素上使用时,让 CSS3 PIE.htc 显示在子元素中

jquery - 取消绑定(bind)验证表单时无法分离 onsubmit 事件

php - 我的网站容易受到此脚本的攻击。我该如何修补它?

javascript - 面对类型错误 : Cannot read property 'counter' of undefined when using Redux in React