2011-02-15 66 views
1

我試圖在Wordpress主題的主頁上使用Coda Slider 2.0,並將其卡在預加載器上。在Firefox和Safari中,我可以看到動畫循環演示欄,背景樣式和「加載...」。在Chrome中,我看到了相同的情況,但進度條的圖像鏈接已損壞。Coda Slider 2.0插件無法在Wordpress上安裝

下面是我用我的頁面爲此目的header.php文件的代碼段(jQuery是較早在頭裝):

<?php if (is_home()) {?> 
    <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jquery.easing.1.3.js"></script> 
    <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jquery.coda-slider-2.0.js"></script> 
    <link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/css/coda-slider-2.0.css" type="text/css" media="screen" /> 
    <script type="text/javascript"> 
     $().ready(function() { 
      $('#coda-slider-1').codaSlider(); 
     }); 
    </script> 
<?php } ?> 

<?php wp_head(); ?> 
</head> 

<body <?php body_class(); ?> class="coda-slider-no-js"> 

<div id="wrapper"> 

    <?php include("contactPanel.php"); ?> 

    <img id="agent" src="<?php bloginfo('template_directory'); ?>/images/agent.png"></img> 
    <h1><a href="<?php blogInfo('url'); ?>">Site Title</a></h1> 

    <div id="contentWrap" class="clearfix"> 

     <ul id="navigation"> 
      <a class="current" href="<?php blogInfo('url'); ?>"><li>Services</li></a> | 
      <a href="<?php blogInfo('url'); ?>/clients"><li>Clients</li></a> | 
      <a href="<?php blogInfo('url'); ?>/news"><li>News</li></a> 
     </ul> 

     <div id="content" class="clearfix"> 

      <?php if (is_home()) {?> 
       <div id="LMOD" class="clearfix"> 

        <div class="coda-slider-wrapper"> 
         <div class="coda-slider preload" id="coda-slider-1"> 
          <div class="panel"> 
           <div class="panel-wrapper"> 
            <h2 class="title">Panel 1</h2> 
            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas metus nulla, commodo a sodales sed, dignissim pretium nunc. Nam et lacus neque. Sed volutpat ante id mauris laoreet vestibulum. Nam blandit felis non neque cursus aliquet. Morbi vel enim dignissim massa dignissim commodo vitae quis tellus. Nunc non mollis nulla. Sed consectetur elit id mi consectetur bibendum. Ut enim massa, sodales tempor convallis et, iaculis ac massa. Etiam suscipit nisl eget lorem pellentesque quis iaculis mi mattis. Aliquam sit amet purus lectus. Maecenas tempor ornare sollicitudin.</p> 
           </div> 
          </div> 
          <div class="panel"> 
           <div class="panel-wrapper"> 
            <h2 class="title">Panel 2</h2> 
            <p>Proin nec turpis eget dolor dictum lacinia. Nullam nunc magna, tincidunt eu porta in, faucibus sed magna. Suspendisse laoreet ornare ullamcorper. Nulla in tortor nibh. Pellentesque sed est vitae odio vestibulum aliquet in nec leo.</p> 
           </div> 
          </div> 
          <div class="panel"> 
           <div class="panel-wrapper"> 
            <h2 class="title">Panel 3</h2> 
            <p>Cras luctus fringilla odio vel hendrerit. Cras pulvinar auctor sollicitudin. Sed lacus quam, sodales sit amet feugiat sit amet, viverra nec augue. Sed enim ipsum, malesuada quis blandit vel, posuere eget erat. Sed a arcu justo. Integer ultricies, nunc at lobortis facilisis, ligula lacus vestibulum quam, id tincidunt sapien arcu in velit. Vestibulum consequat augue et turpis condimentum mollis sed vitae metus. Morbi leo libero, tincidunt lobortis fermentum eget, rhoncus vel sem. Morbi varius viverra velit vel tempus. Morbi enim turpis, facilisis vel volutpat at, condimentum quis erat. Morbi auctor rutrum libero sed placerat. Etiam ipsum velit, eleifend in vehicula eu, tristique a ipsum. Donec vitae quam vel diam iaculis bibendum eget ut diam. Fusce quis interdum diam. Ut urna justo, dapibus a tempus sit amet, bibendum at lectus. Sed venenatis molestie commodo.</p> 
           </div> 
          </div> 
          <div class="panel"> 
           <div class="panel-wrapper"> 
            <h2 class="title">Panel 4</h2> 
            <p>Nulla ultricies ornare erat, a rutrum lacus varius nec. Pellentesque vehicula lobortis dignissim. Ut scelerisque auctor eros sed porttitor. Nullam pulvinar ultrices malesuada. Quisque lobortis bibendum nisi et condimentum. Mauris quis erat vel dui lobortis dignissim.</p> 
           </div> 
          </div> 
         </div><!-- .coda-slider --> 
        </div><!-- .coda-slider-wrapper --> 

       </div><!--LMOD--> 
      <?php } ?> 

任何幫助深表感謝。謝謝閱讀!

回答

0

最好的事情是使用Safari中的開發者菜單(首選項>>高級)或Firebug與Firefox來查看正在加載的JS以及是否存在JS錯誤。

+0

感謝您的回覆。我用Firebug得到的錯誤說「$(」#coda-slider-1「).codaSlider不是一個函數」。我很新,你能指出我在正確的方向上做什麼? – 2011-02-15 21:20:46