2010-10-12 89 views
0

我試圖讓垂直使用jQuery一些文字滾動,我​​一直跟着上http://www.switchonthecode.com/tutorials/using-jquery-slider-to-scroll-a-divjQuery的幻燈片文本垂直

的代碼示例,請能有人指導我如何實現

  1. 位置滑塊垂直
  2. 使文本滾動垂直當滑塊向上或向下移動

編輯:(上@ lonesomeday的答案評論)我已經嘗試設置orientation:vertical和功能handleSliderChange試圖改變

  1. scrollWidthscrollHeight
  2. widthheight
  3. scrollLeftscrollTop

handleSliderSlide但不起作用

非常感謝

回答

0

使用jQuery UI slider,您可以用方向開關做到這一點很容易:

$('#slider').slider({orientation: 'vertical'}); 

在你使用的例子,你應該按照以下方式調用它:

$(document).ready(function(){ 
    $("#content-slider").slider({ 
    animate: true, 
    change: handleSliderChange, 
    slide: handleSliderSlide, 
    orientation: vertical 
    }); 
}); 

請注意,您可能必須進行一些樣式更改才能使其看起來像原始示例一樣漂亮。

+0

謝謝你的時間。我已經嘗試了你的建議,請參閱我編輯的問題。 – 2010-10-12 11:57:27

+0

互聯網上有垂直滑塊教程(例如[this one](http://www.simonbattersby.com/demos/vertical_scrollbar_demo.htm))。我建議你嘗試使用其中之一。 – lonesomeday 2010-10-12 12:30:34

+0

太棒了:)非常感謝 – 2010-10-12 12:55:16