Haha, yeah, it's like using eval() - you just don't do it ;) But seriously, what I did so far is, on load/resize, I check how many images fit in one screen, store this value as perPage, then just go from there - it seems to do the trick.
I'm getting there. Will share my final script here... If it's working or not. On 2010-10-09, at 11:44, Robert wrote: > Hmm, I love cheating, so I would just scroll to the image which is > under "next" button ;) > If You use propagation, You actually click on it... > > ;) > > Actually after some advanced projects I tend to depend on math and > position arithmetics less and less... > > > On 9 Paź, 10:28, Oskar Krawczyk <[email protected]> wrote: >> Hey folks, >> >> I wanted to create something similar >> tohttp://fastflip.googlelabs.com/?source=news, at first it seems like a >> simple side-scroller but there's one feature here I don't know how to get >> working - basically when you click NEXT or PREVIOUS the scroller aligns the >> left side to the image from the next page (or the one that was partly >> shown). Try resizing the window, and clicking NEXT - it'll always scroll to >> the item that's half-shown (on the right). >> >> How would you go about and do it? >> >> My original idea was to filter an element collection for the first element >> that getPosition().x returns a higher value than the container's width >> itself... This proven to be working, but it get's more complicated when we >> start thinking about the second page... There would be a lot of >> storing/reading and looping to get this working. So it seems like this isn't >> the way to go... >> >> This is what I have so far -http://www.jsfiddle.net/oskar/nBu2Z/ >> >> Any ideas? >> >> Oskar
