carousel-slide-dimension on Jquery Cycle2 -fixed width/height

最后都变了- 提交于 2019-12-11 04:49:58

问题


on this page it says you can set the width and height of each slide:

http://jquery.malsup.com/cycle2/demo/carousel.php

carousel-slide-dimension = The width (horz carousel) or height (vert carousel) of each slide. If this option is not set the value will be inferred from the first slide's dimensions.

but how do I exactly add it to the code? It's not clear:

<div class="slideshow" 
    data-cycle-fx=carousel
    data-cycle-timeout=1000
    >
    <img src="http://malsup.github.com/images/beach1.jpg">
    <img src="http://malsup.github.com/images/beach2.jpg">
    ...
    <img src="http://malsup.github.com/images/beach9.jpg">
</div>

回答1:


All the attributes with cycle2 are preceded by "data-cycle-" so for carousel-slide-dimension, you simply add that like so:

data-cycle-carousel-slide-dimension=300

in your slideshow div (and whatever dimension).

Hope this helps!



来源:https://stackoverflow.com/questions/16914587/carousel-slide-dimension-on-jquery-cycle2-fixed-width-height

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!