0

さて、ここに私の問題があります。

おすすめのコンテンツ スライダーを自分の Web サイトに配置するのに、おそらく 10 時間ほど費やしました。私が思いつくことができるものは何でも試してみてください。同じスライダーのおそらく 3 つの異なるバージョンを試しています。

URL は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: Object does not support this property or method in slidetest, line 139 character 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); ?>&amp;h=50&amp;w=80&amp;zc=1&amp;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); ?>&amp;h=300&amp;w=390&amp;zc=1&amp;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>
4

2 に答える 2

0

ばかげた質問かもしれませんが、グーグルライブラリのこれらすべてのスペースは実際にあなたのコードにありますか?IE

<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2    /jquery.min.js'></script>

これはjQueryへの有効な参照ではないため、競合があるかどうかは関係ありません。jQueryは定義されません。

于 2010-11-05T18:26:00.973 に答える
0

テーマの元の作成者は、古いバージョンの jQuery をフッターに不器用な方法で配置していたようです。

それを削除すると、スライダーが機能し始めました。

于 2010-11-06T18:56:01.980 に答える