我有一個頁面在Chrome上運行良好,但在IE或Firefox上不起作用。我把這個Jsfiddle放在一起,它顯示了問題的一部分:https://fiddle.jshell.net/dkwsswdw/2/Jquery無法正常工作Firefox和IE在鏈接上執行的動作點擊
如果你在Chrome上打開它,你應該能夠點擊窗口頂部的向下箭頭並從div向下滾動到div。如果您在Firefox或IE中打開它,它將停止工作。
任何想法?我知道在FF和IE中沒有正確調用jQuery有問題,但我不確定它是如何適用於此問題的。 (我在這看着廣泛而我只是太新,jQuery來弄清楚到底如何適用。)
注:
如果它是有幫助的,這裏的實際循環,我在WordPress的運行,以顯示其職務和「當前」類添加到第一篇文章中的循環:
<?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(); ?>
試過這個,以及基於我在#2另一個線程看到:https://fiddle.jshell.net/dkwsswdw/19/ – ludditedev