我正在使用插件ascensor.js,我试图做一个简单的例子,但它不工作,我看不到错误。
代码处于以下位置:http://jsfiddle.net/C2vLH/2/
JS
$(document).ready(function () {
$('#ascensorBuilding').ascensor({
ascensorName: 'ascensor',
childType: 'section',
ascensorFloorName: ['hello1', 'hello2', 'hello3', 'hello4'],
time: 1000,
windowsOn: 1,
direction: "chocolate",
ascensorMap: [
[1, 0],
[1, 1],
[2, 1]
],
easing: 'easeInOutQuad',
keyNavigation: true,
queued: false,
queuedDirection: "y",
overflow: "hidden"
});
});<button class="ascensor ascensorLink0">hello1</button>
<button class="ascensor ascensorLink1">hello2</button>
<button class="ascensor ascensorLink2">hello3</button>
<button class="ascensor ascensorLink3">hello4</button>
<div id="ascensorBuilding">
<section>Hello1</section>
<section>Hello2</section>
<section>Hello3</section>
<section>Hello4</section>
</div>在结果中,我看到同一页中的所有部分,当我单击按钮时不会发生任何事情.
你知道有类似效果的插件吗?
如有任何建议或建议,将不胜感激。如果你需要更多的信息,让我知道,我会编辑这篇文章。
发布于 2013-05-20 00:25:04
存在多个问题,而且它们并不简单(除非提升者脚本的版本已经过时)。第一个问题相当简单,并说明了最初的问题--一些文档与代码不匹配。特别是,这个案子不符合。
例如,您有childType: 'section' (小写c),但是您需要ChildType: 'section'大写C。所有设置都是如此。
在修复这个之后,乐趣开始了!您指定的各种数组都遵循文档,但是jsfiddle中的提升器脚本正在尝试解析字符串。"hello1 | hello2 |..."和['hello1', 'hello2'...] (AscensorMap的类似问题)。也许提升者的脚本引用是指过时的版本,或者插件已经改变了,而文档还没有更新。
发布于 2014-02-25 15:01:15
与目前的答案相反,现在是正确的。
使用最新版本的Ascensor (1.8.0 (2014-02-23)),您必须以小写指定属性名称。
将ChildType: 'section'改为childType: 'section'。
不幸的是,网络周围的例子都在使用旧版本。
https://stackoverflow.com/questions/16640621
复制相似问题