[英]Jquery slide text vertically
I am trying to make some text scroll vertically using jQuery, I have been following the code example on http://www.switchonthecode.com/tutorials/using-jquery-slider-to-scroll-a-div 我正在尝试使用jQuery使某些文本垂直滚动,我一直在关注http://www.switchonthecode.com/tutorials/using-jquery-slider-to-scroll-a-div上的代码示例
Please can someone guide me on how to achieve 请有人可以指导我如何实现
EDIT : (comment on @lonesomeday's answer) I've already tried setting orientation:vertical
and tried changing 编辑:(评论@lonesomeday的答案)我已经尝试设置了
orientation:vertical
并尝试更改
scrollWidth
to scrollHeight
scrollWidth
到scrollHeight
width
to height
width
height
scrollLeft
to scrollTop
scrollLeft
到scrollTop
in the functions handleSliderChange
and handleSliderSlide
but that doesn't work 在
handleSliderChange
和handleSliderSlide
函数中,但这不起作用
Many thanks 非常感谢
Using the jQuery UI slider , you can do this easily with the orientation switch: 使用jQuery UI滑块 ,您可以使用方向开关轻松完成此操作:
$('#slider').slider({orientation: 'vertical'});
In the example you're using, you should invoke it as follows: 在您使用的示例中,应按以下方式调用它:
$(document).ready(function(){
$("#content-slider").slider({
animate: true,
change: handleSliderChange,
slide: handleSliderSlide,
orientation: vertical
});
});
Note that you'll probably have to make some styling changes to make it look as pretty as the original example. 请注意,您可能必须进行一些样式更改,以使其看起来像原始示例一样漂亮。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.