如何插入此jQuery滑块插件?

时间:2017-01-21 02:42:32

标签: javascript jquery html css

我有HTML和CSS就好了。但是,我似乎无法弄清楚如何正确插入jQuery和插件。我对jQuery和JavaScript有些新意。我必须错误地放置这些,我对如何做到这一点很困惑。看起来很简单,但我没有看到它。

以下是我从以下地方获取代码的参考: http://www.jqueryscript.net/rotator/Infinite-Looping-Scroller-Plugin-With-jQuery-loopmovement.html

以下是我放在HTML底部的JS链接

<script src="//code.jquery.com/jquery-1.12.0.min.js"></script>
	<script src="js/jquery.loopmovement.min.js"></script>
	
	<script src="js/jquery.loopmovement.js"></script>

As you can see the HTML and CSS are fine, but nothing works as it should. It's not moving. enter image description here

2 个答案:

答案 0 :(得分:0)

我的猜测是你应该:

1 - 从插件网站下载javascript文件

2 - 将它们保存在项目的'js'文件夹中(如果你没有,请创建一个)

3 - 使用通常的<script src="">代码链接html中的文件。

这可以使你的插件工作。

答案 1 :(得分:0)

&#13;
&#13;
render: function() {
    const { teams } = this.state;

    return (
        <div className="list-group">
            { teams.map((team) => {
                return ([
                    <a href={ "http://localhost:5000/api/teams?name=" + team.name} onClick={ this.action }>Click Me</a>
                ]);
            })}
        </div>
    )
}
&#13;
$('#box1').loopmovement({
  'direction':'top', 	
  'speed':20
});
&#13;
&#13;
&#13;

请您参考我上面的代码吗?

相关问题