好的,所以這是我的問題。Jquery - 精選內容滑塊不工作
我一直花費大概10個小時試圖在我的網站上放置一個精選內容滑塊。嘗試我能想到的任何事情。嘗試可能3個不同版本的相同的滑塊。
的網址是:http://www.heartofphoto.com/slidetest/
但不管怎麼說,這裏是我目前有打算:
在標頭,我已經成功地得到這樣的:
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'></script>
<script type='text/javascript'>try{jQuery.noConflict();}catch(e){};</script>
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.3/jquery-ui.min.js'></script>
具有或不具有「noconflict」部分似乎沒有什麼區別。我相信在我爲Wordpress安裝「google libary」插件後,noconflict部分進來了。
這裏是劇本,我有頁面內應顯示滾動條:
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery("#featured").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 5000, true);
});
</script>
有了這樣一個在「featured.php」文件我做了,還是有它在的header.php包含在頂部的文件沒有區別。
所以,任何人都有線索我做錯了什麼?
部分編輯: 我得到錯誤SCRIPT438:對象不支持slidetest此屬性或方法,行139字3. 這是這一行:
jQuery("#featured").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 5000, true);
而對於那些你想要的看到我的HTML。這個版本實際上是用一個PHP的設置來獲得數據:
<div id="featured" >
<ul class="ui-tabs-nav">
<?php
$postcount = 0;
$featured_query = new WP_Query('cat=29');
while ($featured_query->have_posts()) : $featured_query->the_post();
get_the_ID();
$postcount++;
?>
<?php
// get the image filename
$value_feat_img = get_post_custom_values("thumbnail");
if (isset($value_feat_img[0])) { ?>
<li class="ui-tabs-nav-item ui-tabs-selected" id="nav-fragment-<?php echo $postcount; ?>"><a href="#fragment-<?php echo $postcount; ?>">
<img src="<?php echo bloginfo('template_url'); ?>/thumb.php?src=<?php echo get_post_meta($post->ID, "thumbnail", $single = true); ?>&h=50&w=80&zc=1&q=95" alt="<?php the_title(); ?>" /><span><?php the_title(); ?></span></a><?php } ?>
</li>
<?php endwhile; ?>
</ul>
<?php
$postcount = 0;
$featured_query = new WP_Query('cat=29');
while ($featured_query->have_posts()) : $featured_query->the_post();
get_the_ID();
$postcount++;
?>
<!-- Content -->
<div id="fragment-<?php echo $postcount; ?>" class="ui-tabs-panel" style="">
<?php // get the image filename
$value_img = get_post_custom_values("thumbnail");
if (isset($value_img[0])) { ?>
<img src="<?php echo bloginfo('template_url'); ?>/thumb.php?src=<?php echo get_post_meta($post->ID, "thumbnail", $single = true); ?>&h=300&w=390&zc=1&q=95" alt="<?php the_title(); ?>" />
<?php } ?>
<div class="info" >
<h2><a href="<?php the_permalink() ?>" ><?php the_title(); ?></a></h2>
<?php the_excerpt(); ?>
</div>
</div>
<?php endwhile; ?>
</div>
控制檯中是否有錯誤? – Harmen 2010-11-05 17:49:02
你的html是什麼樣的? – generalhenry 2010-11-05 17:53:05
我得到這個「SCRIPT438:對象不支持此屬性或方法」在slidetest,線路139字符3. 至極是 的jQuery(「#精選」)標籤({FX:{不透明:「切換」 }})。tabs(「rotate」,5000,true); row – Alexander 2010-11-05 18:09:57