好的,所以这是我的问题。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