javascript - JavaScript 中的垂直 slider

标签 javascript jquery html css

我需要在java脚本中垂直 slider 。 slider 应该这样:单击加号[+] 时它会向下滑动,单击[-] 时它会向上滑动。从数据库中选取内容并显示在屏幕上。我需要以下代码的 slider 。

<ck:forEach items="${headings}" var="headings">
  <input type="button" value="<ck:out value="${headings.description}" />"><br>
  <ck:forEach items="${descriptions}" var="descriptions">
        <ck:if test="${headings.identifier == descriptions.identifier}">                    
                <ul><li><ck:out value="${descriptions.text}" /></li></ul>                   
        </ck:if>
  </ck:forEach>
        <br>
</ck:forEach>

我无法使用 JQuery 插件。

谢谢

最佳答案

你可以试试这个:

jQuery(document).ready(function($) {
   $('#simple-vertical').royalSlider({
    arrowsNav: true,
    arrowsNavAutoHide: false,
    fadeinLoadedSlide: true,
    controlNavigation: 'none',
    imageScaleMode: 'fill',
    imageAlignCenter:true,
    loop: false,
    loopRewind: false,
    numImagesToPreload: 4,
    slidesOrientation: 'vertical',
    keyboardNavEnabled: true,
    video: {
      autoHideArrows:true,
      autoHideControlNav:true
    },  

    autoScaleSlider: true, 
    autoScaleSliderWidth: 960,     
    autoScaleSliderHeight: 850,

    /* size of all images http://help.dimsemenov.com/kb/royalslider-jquery-plugin-faq/adding-width-and-height-properties-to-images */
    imgWidth: 640,
    imgHeight: 360
  });
});

DEMO PAGE

关于javascript - JavaScript 中的垂直 slider ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32837840/

相关文章:

javascript - offsetHeight 获取 div 元素的不正确高度

html - 为什么当我将 CSS 放在外部文件而不是 &lt;header&gt; 标签内时它会停止工作?

javascript - 日期值不断返回 NaN

javascript - jQuery 动态创建表/tr/td 等并附加属性

javascript - 启用日期时间选择器的手动编辑

javascript - anchor 不滚动到顶部

jquery - Owl Carousel ,导航中心

html - 元素在上边距后填充页面的其余部分

javascript - jQuery 图像幻灯片 - 最后一张幻灯片出现时没有移动

javascript - 使用 jQuery 附加转义文本?