首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >carouFredSel不是函数错误

carouFredSel不是函数错误
EN

Stack Overflow用户
提问于 2015-07-22 10:04:00
回答 1查看 1.2K关注 0票数 1

我正在努力建立carouFredSel。我做的每件事都是正确的-所有的链接都能工作。我正在使用智能模板将其添加到网上商店。我在chrome控制台中得到了这个错误:

Uncaught :jQuery(.).carouFredSel不是函数

header.tpl头部部分

代码语言:javascript
复制
<!-- jQuery -->       
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js" type="text/javascript"></script>  
<!-- CarouFredSel -->
<script src="http://serwer1449841.home.pl/autoinstalator/wordpress/wp-includes/js/jquery.carouFredSel-6.2.1.js" type="text/javascript"></script> 

{literal}
    <script type="text/javascript">
    jQuery(function() {
          jQuery('#carousel').carouFredSel({
                items                : 2,
                direction            : "up",
                scroll : {
                    items            : 1,
                    easing            : "elastic",
                    duration        : 1000,
                    pauseOnHover    : true
                }
            });
        });
    </script>
{/literal}

footer.tpl

代码语言:javascript
复制
<div id='carousel'>
    <img src='http://example.com/img1.png' width='105' />
    <img src='http://example.com/img2.png' width='110' />
    <img src='http://example.com/img3.png' width='105' />
    <img src='http://example.com/img4.png' width='120' />
    <img src='http://example.com/img5.png' width='105' />
    <img src='http://example.com/img6.png' width='200' />
</div>

css

代码语言:javascript
复制
#carousel img {
    padding: 16px 10px 14px 10px;
}

#carousel {
    width: 1178px;
    height: 126px;
    margin: 0 auto;
}

去旋转木马的路是对的,我错过了什么?

EN

回答 1

Stack Overflow用户

发布于 2016-12-15 07:25:57

我有同样的问题,这个答案帮助了我,bug.cgi?id=879298#c3

代码语言:javascript
复制
<ol>
  <li>jQuery loaded into DOM</li>
  <li>caroFredSel plugin is attached to jQuery in DOM</li>
  <li>Something is causing ANOTHER instance of jQuery to load into the DOM, overwriting the previous $ object.</li>
  <li>When caroFredSel() is called on the $ object in carousel.js, since it is a new jQ object, the method doesn't exist.</li>
</ol>

希望这对你也有帮助

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31559987

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档