문제

There is my problem: fiddle

$("#timeline").draggable({
    axis: "x",
    containment: [-2110, 0, 0, 0]
});

I made the simple draggable image but i want to add a slider like this http://jqueryui.com/slider/#side-scroll.

도움이 되었습니까?

해결책

You don't need to use javascript for this unless you want a custom scroll bar or to be able to drag with your mouse (a touch device would work just fine, though). You can get away with simply putting the image in a container and just setting overflow: auto on it.

http://jsfiddle.net/LMXLj/146/embedded/result/

If you want it to be draggable with a mouse, which isn't the most natural thing, you don't want to be using .draggable(). You would want to look into a plugin like dragscroll.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top