jQuery Cycle适用于独立页面,但不适用于WordPress



这个没有任何意义。我在WP中为一个特色图像滑块使用jQuery循环,但它已停止工作。

为了诊断出了什么问题,我对其中一个例子进行了简化,它很有效:http://convoke.info/slide.php

然而,如果我使用完全相同的标记并将其复制到我的一个WordPress页面中,则插件不起作用:http://convoke.info/cycle/

这是我的WP头的声明:

<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" type="text/css" href="http://convoke.info/wp-content/themes/convoke2theme/style.css" />
    <!-- include jQuery library -->
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
    <!-- include Cycle plugin -->
    <script type="text/javascript" src="http://cloud.github.com/downloads/malsup/cycle/jquery.cycle.all.latest.js"></script>
    <script type="text/javascript">
        $(document).ready(function() {
            $('#featuredslider').cycle({
                fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
            });
        });
    </script>
</head>

这里是我的图像:

<div id="featuredslider">
    <img src="http://cloud.github.com/downloads/malsup/cycle/beach1.jpg" width="200" height="200" />
    <img src="http://cloud.github.com/downloads/malsup/cycle/beach2.jpg" width="200" height="200" />
</div>

我唯一的想法是为什么会发生这种情况,这只是一个疯狂的猜测,但我最近将有问题的网站(Convoke.info)转换回到一个单独的网站。它曾经是MU或一个站点网络。

WordPress中的jQuery在无冲突模式下运行。改为使用:
jQuery(document).ready(function($) { }

最新更新