【发布时间】:2015-08-01 03:32:28
【问题描述】:
我遇到了这个神奇的插件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 参考?尝试包装您的代码 inn DOM 就绪处理程序
$(function(){}) -
@ShaunakD TypeError: $(...).steps 不是函数
-
插件似乎没有加载。验证路径
../Scripts/jquery.steps.min.js。另外,您在哪里包含 HTML 中的引用? -
@ShaunakD 是的,我添加了 jquery-1.11.2.js 参考并尝试将 javascript 放入 dom 就绪
-
您在 HTML 部分的哪个部分包含
<script src="../Scripts/jquery.steps.min.js" type="text/javascript"></script>?
标签: javascript jquery asp.net jquery-plugins