我正在尝试使用jquery插件,它的名字叫ancensor。
插件页面为http://jque.re/plugins/image-galleries-decks/ascensor/#/Home
我有像这样的东西
<nav class='navbar navbar-default' role='navigation '>
<ul class='alinks list-inline links-to-floor'>
<li class="list-group-item"><a href='#' class="ascensorLink ascensorLink1">test1</a></li>
<li class="list-group-item"><a href='#' class="ascensorLink ascensorLink2" >test2</a></li>
<li class="list-group-item"><a href='#' class="ascensorLink ascensorLink3">test3</a></li>
<li class="list-group-item"><a href='#' class="ascensorLink ascensorLink4">test4</a></li>
<li class="list-group-item"><a href='#' class="ascensorLink ascensorLink5">test5</a></li>
</ul>
</nav>
<div id='ascensorBuilding'>
<div class='ascensorFloor1' style=''>
test here
</div>
<div class='ascensorFloor2' style='height:1200px; width:1000px; background-color:red;'>
blog hree oooo
</div>
<div class='ascensorFloor3' style='height:1200px; width:1000px; background-color:red;'>
aaagg
</div>
<div class='ascensorFloor4' style='height:1200px; width:1000px; background-color:red;'>
dddd
</div>
<div class='ascensorFloor5' style='height:1200px; width:1000px; background-color:red;'>
ddd
</div>
<script src="/lib/jquery-1.8.0.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script>
<script src="/lib/jquery.ascensor.js"></script>
<script src="/lib/bootstrap/js/bootstrap.min.js"></script>
<script>
$(function() {
$('#ascensorBuilding').ascensor({
AscensorName: 'ascensor',
AscensorFloorName: '1.0 | 1.1 | 1.3 | 4.3 | 5.4 | 5.5 | 5.6 | 7.6 | 8.6 | 8.7 | 8.8 | 8.9 | 10.2',
Time: 9000,
WindowsOn: 1,
Direction: "chocolate",
AscensorMap: '1|1 & 2|1 & 3|1 & 3|2 & 3|3 & 4|3 & 5|3 & 3|4 & 3|5 & 4|5 & 5|5 & 6|5 & 3|6',
Easing: 'easeInOutQuad',
KeyNavigation: true,
Queued: false,
QueuedDirection: "y"
})
});
</script>我已经跟随插件页面的方向,但仍然不能让它工作。有没有人能帮我一下?非常感谢!
发布于 2014-01-16 03:01:17
您正在将每个楼层的类设置为ascensorFloorX。您需要将id设置为这些值。您可以通过查看所链接页面的源代码来查看工作示例。
也就是说,
<div class='ascensorFloor1' style=''>
^应该是这样的
<div id='ascensorFloor1' style=''>
^此外,您的<div id='ascensorBuilding'>缺少结束标记。
发布于 2014-01-16 03:06:38
基于文档。您应该先尝试使用<section>,当它正常工作时,根据您的需要进行更改。
HTML链接
<li><a class="ascensorLink ascensorLink1"></a></li>
<li><a class="ascensorLink ascensorLink2"></a></li>HTML内容
<div id="ascensorBuilding">
<section>
//floor one content here
</section>
<section>
//floor two content here
</section>
<section>
//floor three content here
</section>
</div>JAVASCRIPT
$('#ascensorBuilding').ascensor({
AscensorName:'ascensor',
ChildType:'section',
AscensorFloorName:'Home | Implementation ',
Time:1000,
WindowsOn:1,
Direction:'chocolate',
AscensorMap:'2|1 & 2|2 & 3|2 & 2|3 & 2|4 & 1|4 & 2|5',
Easing:'easeInOutQuad',
KeyNavigation:true,
Queued:false,
});https://stackoverflow.com/questions/21145550
复制相似问题