jQuery滑块在Chrome中不起作用?

时间:2011-11-21 16:25:54

标签: jquery

我的jQuery滑块在Chrome中不起作用。它只显示导航而没有其他DOM元素。似乎在Firefox中正常工作。

我可以在这里使用一些帮助。谢谢!

http://staging.nvcc.edu/businesses-and-community/workforce-development/_index-damon2.html

HTML:

<div id="featured-event">
  <div id="featured-event-in">
    <div class="event-listing"><a href="http://www.nvcc.edu/wdce/annandale/courses/onlinelearning/taxprep.asp"><img alt="The Income Tax School" src="../images/taxschool-ad.jpg" width="200"/>
      <div class="event-caption">
        <h3>NOVA now offers online courses in tax preparation. </h3>
        <p>Learn More</p>
      </div>
      </a></div>
    <div class="event-listing"><a href="#"><img alt="Spring 2012 Catalog" src="../images/catalog-ad.png" width="200"/>
      <div class="event-caption">
        <h3>Spring 2012 Catalog Now Available</h3>
        <p>Sign up for a course today!</p>
      </div>
      </a></div>
  </div>
</div>

JavaScript的:

<script src="../../_assets/js/jquery-1.4.4.js" type="text/javascript"></script>
<script src="../../_assets/js/jquery.cycle.all.2.72.js" type="text/javascript">   </script>
  <script type ="text/javascript">
$(document).ready(function(){
    $('#featured-event-in').after('<div id="navCycle">').cycle({ 
        fx:      'scrollLeft', 
        speed:    300, 
        timeout:  3500,
        pause: 1,  
        next: '#next2', 
        pager: '#navCycle'
    });
})  

2 个答案:

答案 0 :(得分:0)

将CSS高度添加到div(ID为&#39; featured-event-in&#39;)。

答案 1 :(得分:0)

我不知道这是否会解决您的问题,但您的网页包含重复的元素ID。 id每个元素必须是唯一的,否则浏览器可能会忽略后续实例。

<div id="inside-campus">

http://validator.w3.org/check?uri=http%3A%2F%2Fstaging.nvcc.edu%2Fbusinesses-and-community%2Fworkforce-development%2F_index-damon2.html&charset=%28detect+automatically%29&doctype=Inline&group=0