[英]Jquery-Steps plug in not working?
我遇到了一个了不起的插件http://www.jquery-steps.com/Examples我一直在尝试使其工作,但似乎我缺少了一些东西。
我已经添加了对该文件的引用:
<script src="../Scripts/jquery.steps.min.js" type="text/javascript"></script>
我的标记看起来像这样:
<div id="example-basic">
<h3>Keyboard</h3>
<section>
<p>Try the keyboard navigation by clicking arrow left or right!</p>
</section>
<h3>Effects</h3>
<section>
<p>Wonderful transition effects.</p>
</section>
<h3>Pager</h3>
<section>
<p>The next and previous buttons help you to navigate through your content.</p>
</section>
</div>
JavaScript看起来像这样:
<script type="text/javascript">
$("#example-basic").steps({
headerTag: "h3",
bodyTag: "section",
transitionEffect: "slideLeft",
autoFocus: true
});
</script>
我们必须使用最新的jquery,因为此插件在jquery的功能时使用。 这解决了我的问题。
http://code.jquery.com/jquery-2.1.4.js
您必须将最后一个脚本代码放置在body标签关闭之前,如下所示:
<body>
<div id="steps">
<h1>First Step</h1>
<section>First Content</section>
<h1>Second Step</h1>
<section>Second Content</section>
</div>
<script>
$("#steps").steps(
{
headerTag : "h1",
bodyTag : "section",
cssClass: "wizard"
}
);
</script>
</body>
另外,这是一个必须存在的基本css文件:
<script src="./javascripts/jquery.steps.js"></script>
可以在项目的git hub页面上找到。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.