未捕获的类型错误:Wordpress Jquery 幻灯片 - 对象没有方法


Uncaught TypeError: Wordpress Jquery slideshow - Object has no method

我在wordpress主题中使用简单的jquery幻灯片时遇到了问题。我可以让它在标准 HTML 中工作,但一旦我把它放在 php 中,我就会得到"未捕获的类型错误:对象 # 没有方法'easeOutCirc'。

幻灯片已集成到标题文档中

标头中的脚本.php

                <script type="text/javascript">
        (function($) {
            $(function() {
                $('#slideshow').cycle({
                    fx:     'scrollHorz',
                    timeout: 7000,
                    next:   '#rarr',
                    prev:   '#larr'
                });
                $(".tabContent:not(:first)").hide();
                $(".tabContent").eq(0).show();  
                $("#tabNav li:first").addClass("active");
                    $("#tabNav li").click(function(){
                        $(".tabContent").hide();
                        $("#" + $(this).attr("tagger")).show();
                        $("#tabNav .active").removeClass("active");
                        $(this).addClass("active");
                    });
            })
        })(jQuery)
    </script>

幻灯片标记(在页眉.php中)

            <div class="rotator">
            <ul id="rotmenu">
                <li>
                    <a href="rot1">Christmas Markets</a>
                    <div style="display:none;">
                        <div class="info_image">Magdeburgchristmasmarket.jpg</div>
                        <div class="info_heading">Christmas Markets</div>
                        <div class="info_description">
            From the aromas of freshly baked gingerbread, cinnamon and gluhwein to the joyous sounds of carol singers, sparkling fairy lights and pretty wooden stalls, a pre-Christmas break to one of Europe’s Christmas Markets...
                            <a href="christmas.html" class="more">Read more</a>
                        </div><!-- END description -->
                    </div><!-- END display none -->
                </li>
                <li>
                    <a href="rot2">New Story2</a>
                    <div style="display:none;">
                        <div class="info_image">olympic-logo-copy.jpg</div>
                        <div class="info_heading">New Story2</div>
                        <div class="info_description">
            Second story content to continue reading click read more after text finishes...
                            <a href="#" class="more">Read more</a>
                        </div><!-- END description -->
                    </div><!-- END display none -->
                </li>
                <li>
                    <a href="rot3">New Story3</a>
                    <div style="display:none;">
                        <div class="info_image">Loch-Lomond-beautiful-scotland-by-coach-holiday.jpg</div>
                        <div class="info_heading">New Story3</div>
                        <div class="info_description">
            ....
                            <a href="#" class="more">Read more</a>
                        </div><!-- END description -->
                    </div><!-- END display none -->
                </li>

            </ul><!-- END rot menu -->
            <div id="rot1">
                <img src="" width="900" height="300" class="bg" alt=""/>
                <div class="heading">
                    <h1></h1>
                </div>
                <div class="description">
                    <p></p>
                </div> <!-- END description -->   
            </div><!-- END rot1 -->
        </div><!-- END rotator -->

以及页脚中的脚本.php文档

        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
    <script type="text/javascript" src="jquery.easing.1.3.js"></script>
    <script type="text/javascript">
        $(function() {
            var current = 1;
            var iterate     = function(){
                var i = parseInt(current+1);
                var lis = $('#rotmenu').children('li').size();
                if(i>lis) i = 1;
                display($('#rotmenu li:nth-child('+i+')'));
            }
            display($('#rotmenu li:first'));
            var slidetime = setInterval(iterate,4000);
            $('#rotmenu li').bind('click',function(e){
                clearTimeout(slidetime);
                display($(this));
                e.preventDefault();
            });
            function display(elem){
                var $this   = elem;
                var repeat  = false;
                if(current == parseInt($this.index() + 1))
                    repeat = true;
                if(!repeat)
                    $this.parent().find('li:nth-child('+current+') a').stop(true,true).animate({'marginRight':'-20px'},300,function(){
                        $(this).animate({'opacity':'0.7'},700);
                    });
                current = parseInt($this.index() + 1);
                var elem = $('a',$this);
                    elem.stop(true,true).animate({'marginRight':'0px','opacity':'1.0'},300);
                var info_elem = elem.next();
                $('#rot1 .heading').animate({'left':'-420px'}, 500,'easeOutCirc',function(){
                    $('h1',$(this)).html(info_elem.find('.info_heading').html());
                    $(this).animate({'left':'0px'},400,'easeInOutQuad');
                });
                $('#rot1 .description').animate({'bottom':'-270px'},500,'easeOutCirc',function(){
                    $('p',$(this)).html(info_elem.find('.info_description').html());
                    $(this).animate({'bottom':'0px'},400,'easeInOutQuad');
                })
                $('#rot1').prepend(
                $('<img/>',{
                    style   :   'opacity:0',
                    className : 'bg'
                }).load(
                function(){
                    $(this).animate({'opacity':'1'},600);
                    $('#rot1 img:first').next().animate({'opacity':'0'},700,function(){
                        $(this).remove();
                    });
                }
            ).attr('src','images/'+info_elem.find('.info_image').html()).attr('width','900').attr('height','300')
            );
            }
        });
    </script>

我们是否遗漏了剧本中的任何内容?任何建议将不胜感激!

谢谢

jQuery UI Effects 不包含在 jquery-ui-core 句柄中。参见法典

您可能必须从 url 加载自定义 jquery-ui 包。下面将从谷歌CDN加载完整的jquery UI

浏览器
<?php wp_enqueue_script("myUi","https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.8/jquery-ui.min.js"); ?>