我无法弄清楚为什么滑块的性能与此处的文档页面上的不完全相同:http: //foundation.zurb.com/docs/components/orbit.html
我们的网站在 这里:
这是代码。我认为它应该是这个最小的标记,其余的东西应该在以后添加:
<ul data-orbit>
<li>
<img src="img/sliders/lightcubebeta1000.png" >
<div class="orbit-caption">...</div>
</li>
<li>
<img src="img/sliders/hammertime1000.png">
<div class="orbit-caption">...</div>
</li>
<li>
<img src= "img/sliders/alarmclockbeta1000.png">
<div class="orbit-caption">...</div>
</li>
</ul>
Javascript的初始化:
<!-- Javascript for Orbit Image Slider -->
<script>
document.write('<script src=`javascripts/vendor/'
+ ('__proto__' in {} ? 'zepto' : 'jquery')
+ '.js><\/script>')
</script>
<script src= "javascripts/foundation/foundation.js"></script>
<script src= "javascripts/foundation/foundation.dropdown.js"></script>
<script src= "javascripts/foundation/foundation.section.js"></script>
<script src= "javascripts/foundation/foundation.topbar.js"></script>
<script src= "javascripts/foundation/foundation.orbit.js"></script>
<!-- Initialize Foundation -->
<script>
$(document).foundation('orbit', {
timer_speed: 10000,
pause_on_hover: true,
resume_on_mouseout: true,
animation_speed: 500,
bullets: true,
stack_on_small: true,
container_class: 'orbit-container',
stack_on_small_class: 'orbit-stack-on-small',
next_class: 'orbit-next',
prev_class: 'orbit-prev',
timer_container_class: 'orbit-timer',
timer_paused_class: 'paused',
timer_progress_class: 'orbit-progress',
slides_container_class: 'orbit-slides-container',
bullets_container_class: 'orbit-bullets',
bullets_active_class: 'active',
slide_number_class: 'orbit-slide-number',
caption_class: 'orbit-caption',
active_slide_class: 'active',
orbit_transition_class: 'orbit-transitioning'
});
</script>
尽管我尽最大努力复制文档页面上的示例,但轨道图像滑块会同时从上到下显示所有图像,并带有项目符号和箭头。我犯了错误还是基础 4 文档中的示例有问题?
谢谢你!