SlidesJS-TypeError:$(...).slidesjs不是函数 [英] SlidesJS - TypeError: $(...).slidesjs is not a function

查看:131
本文介绍了SlidesJS-TypeError:$(...).slidesjs不是函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的网站上实现SlidesJS插件,但是在页面加载时出现以下错误:

I'm trying to implement the SlidesJS plugin on my site, but when the page loads i get the following error:

TypeError: $(...).slidesjs is not a function

我的html是:

<div class="slider">
    <div class="container">
        <div id="slides">
                <img src="<?= img('slides/example-slide-1.jpg') ?>" alt="photo 1">
                <img src="<?= img('slides/example-slide-2.jpg') ?>" alt="photo 2">
                <img src="<?= img('slides/example-slide-3.jpg') ?>" alt="photo 3">
                <img src="<?= img('slides/example-slide-4.jpg') ?>" alt="photo 4">
                <a href="#" class="slidesjs-previous slidesjs-navigation"><i class="icon-chevron-left icon-large"></i></a>
                <a href="#" class="slidesjs-next slidesjs-navigation"><i class="icon-chevron-right icon-large"></i></a>
        </div>
    </div>
</div>

我的css文件包含:

.slider #slides {
    display: none;
}

我的js文件包含:

    $(document).ready(function() {

    ...

    $("#slides").slidesjs({
            width: 1000,
            height: 290
        });
    }

我同时包含了jQuery和插件的特定脚本,但是仍然出现此错误. 我想念什么吗?

I've included both jQuery and the plugin's specific script, but I still get this error. Am I missing anything?

推荐答案

我遇到了同样的问题,并通过将文件包含移动到页面页脚来解决了这个问题.

I had the same problem and solved it by moving the file inclusion to the page footer.

这篇关于SlidesJS-TypeError:$(...).slidesjs不是函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆