What does scrollLeft() function of jquery do? What does it mean when I write $(window).scrollLeft(),$(window).scrollLeft(1300), $("div.test").scrollLeft() and $("div.test").scrollLeft(1000)?
views:
32answers:
2The above link will answer your questions.
Manie
2010-08-17 07:05:02
yeah, the problem is I couldn't understand what the documentation is trying to say..... :-(
Night Shade
2010-08-17 07:05:33
+1
A:
I'm assuming you're talking about the CSS .scrollLeft() method?
Description: Get the current horizontal position of the scroll bar for the first element in the set of matched elements.
The horizontal scroll position is the same as the number of pixels that are hidden from view above the scrollable area. If the scroll bar is at the very left, or if the element is not scrollable, this number will be 0.
In other words, it tells you and lets you set how many pixels the page (or an element) is scrolled horizontally.
deceze
2010-08-17 07:04:29
does that mean if I call $("div").scrollLeft(200), all the divs will get scrolled horizontally by 200 pixels?
Night Shade
2010-08-17 08:34:28
@Sayem Apply some fixed width of {x} pixels and `overflow: auto` or `overflow: scroll` and insert content that is wider than {x} pixels.
deceze
2010-08-17 09:01:33
hmm, got it...could you tell me what will happen when I call $(window).scrollLeft(1300)?
Night Shade
2010-08-17 09:02:53
he he...you are right. Anyway thanks a lot...talking with you has given me a more clear picture.
Night Shade
2010-08-17 09:14:01