Jquery-特色内容滑块不工作
好吧,这是我的问题 我大概花了10个小时在我的网站上放一个特色内容滑块。尝试我能想到的任何东西。尝试同一滑块的3个不同版本 网址是: 但无论如何,我现在要做的是: 在标题中,我成功地获得了以下信息:Jquery-特色内容滑块不工作,jquery,jquery-ui,slider,featured,Jquery,Jquery Ui,Slider,Featured,好吧,这是我的问题 我大概花了10个小时在我的网站上放一个特色内容滑块。尝试我能想到的任何东西。尝试同一滑块的3个不同版本 网址是: 但无论如何,我现在要做的是: 在标题中,我成功地获得了以下信息: <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'></script> <script type='text/javas
<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>
对于那些想看我的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>
这可能是一个愚蠢的问题,但是,google库调用中的所有空格是否都存在于代码中?即
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2 /jquery.min.js'></script>
我这样问是因为这不是对jQuery的有效引用,所以不管是否存在冲突,jQuery都不会被定义。主题的原始创建者似乎在页脚中笨拙地将旧版本从jQuery中删除了
删除它使我的滑块开始工作。您的控制台中有任何错误吗?您的html是什么样子的?我在slidetest第139行第3个字符处看到“SCRIPT438:对象不支持此属性或方法”。Wich是jQuery(“#特色”).tabs({fx:{opacity:{toggle:}});这很奇怪,因为当我看我的页面时,我看不到。我实际上使用了wordpress函数来加载库。(wp_enqueue_脚本)我现在意识到我在写文章时意外地添加了它。不,它不应该在那里。
<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>
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2 /jquery.min.js'></script>