gpt4 book ai didi

javascript - jQuery animatescrolltop() 在 IE10 中不向下滚动

转载 作者:行者123 更新时间:2023-12-03 10:20:21 25 4
gpt4 key购买 nike

当我应用此代码并在 Internet Explorer 和 FireFox 中测试此代码时,单击时,页面不会使用切换功能向下滚动,但在关闭覆盖层后会向上滚动。这在 Google Chrome 中运行良好,但在 IE 10 或 Firefox 中不起作用。请帮忙。 :)

  $(document).ready(function(){


$(".PlaceHolders").click(function(e){

e.preventDefault();
$(".overlay").slideToggle(2000, function(){

$("#url_placeholder").text($(this).is(':visible') ? "Close Components" : "View Available Components");
});
$('html','body').animate({scrollTop: $(".PlaceHolders").offset().top}, 2000);
});

最佳答案

这只是您的选择器。请参阅http://codepen.io/anon/pen/MYNZzW

   $('html,body').animate({scrollTop: $(".PlaceHolders").offset().top}, 2000);

关于javascript - jQuery animatescrolltop() 在 IE10 中不向下滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29666173/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com