Jquery 无法使用 Firefox 和 IE 执行 link 点击操作

Jquery not working Firefox and IE for action executed on link click

我有一个页面在 Chrome 上运行良好,但在 IE 或 Firefox 上运行不佳。我把这个 Jsfiddle 放在一起,它显示了部分问题:https://fiddle.jshell.net/dkwsswdw/2/

如果您在 Chrome 上打开它,您应该可以单击 window 顶部的向下箭头,然后从 div 向下滚动到 div.如果您在 Firefox 或 IE 中打开它,它将停止工作。

有什么想法吗?我知道 jQuery 在 FF 和 IE 中没有被正确调用是有问题的,但我不确定它如何适用于这个问题。 (我对此进行了广泛的研究,但我对 jQuery 还太陌生,无法弄清楚这到底是如何应用的。)

注:

如果有帮助,这是我在 Wordpress 中 运行 的实际循环,用于显示 post 并将 'current' class 添加到第一个 post 在循环中:

<?php

        // The Arguments
        $args = array(
            'post_type' => 'strange',
            'posts_per_page' =>-1, 
            'order_by' => 'menu_order'

        );

        $c = 0; 
        $class = ''; 

        // The Query
        $the_query = new WP_Query( $args ); ?>

        <?php

        // If we have the posts...
        if ( $the_query->have_posts() ) : ?>

        <!-- Start the loop the loop --> 
            <?php while ( $the_query->have_posts() ) : $the_query->the_post(); 
            $c++; 
            if ( $c == 1 ) $class .= ' current'; // if the item is the first item, add class current
            else $class = ''; 
            ?>

                <div id="strange-container" class="strange-container <?php echo $class; ?>">    

                    <img src="<?php the_field('strange-img'); ?>" alt="<?php the_title(); ?>" />

                    <span><?php the_field('strange-text'); ?></span>

                </div>

            <?php endwhile; endif; ?>

        <?php wp_reset_postdata(); ?>

仅供参考,您的图片在 htpasswd 后面。

就是说,有些浏览器喜欢在 body 上设置动画,而另一些浏览器则喜欢在 html 上设置动画。更改您的行,如下所示:

$('body').animate({

对此:

$('html,body').animate({