This could be one for our friends at Softpress, but I’d like an addition to the current two options now provided as a trigger (mouse-over and click).
Is it possible to trigger an event by scrolling? So when the triggered item comes within the bounderies of the browser-window it starts its transition?
I’ve seen this quit regularly on the apple website and others …
That’s totally possible, from the standpoint of it being possible to write in Scriptaculous (upon which the FX Actions stand). I would imagine that SP have their collective hands a little full right at the moment.
My knowledge of scripting itself is far too limited (if not even present), but I usually just firebug the crap out of a page to isolate the effect or behavior I’m trying to replicate. I’m curious enough to try and figure it out myself if only I knew where to start looking, and what for. I just don’t know how his behavior is called in order to Google it.
Take a look at my lazy-load example (search here for that term) to see what the arithmetic looks like. The basic thing is to subtract the element’s positionedOffset()[‘top’] from the document.viewport.getScrollOffsets()[‘top’] + document.viewport.getHeight(), and see if there’s a remainder. If there is, the element is still below the fold. If not, it’s visible or above the fold. You can do even more in this vein, to determine if an element can actually be seen at the moment, by considering if the bottom of the thing is above the fold (which is the same calculation but with the getHeight being on the element itself, not the viewport).
Once you know the visibility of that element, you can call the effect. Unfortunately, the way that the FX Actions are written, you can’t just fire an event and know that the effect will fire, your scroll observer will have to know way too much about the elements it is trying to affect. If the element was set in FX to be triggered by a mouseover, you will have to know the ID of that element (which may involve giving it one in the first place) and you will have to call its onmouseover() method, like this $('item42').onmouseover() inside the scroll observer function.
Walter
On Jan 13, 2013, at 9:00 AM, Richard van Heukelum wrote:
Well, let’s hope for such an improvement then
My knowledge of scripting itself is far too limited (if not even present), but I usually just firebug the crap out of a page to isolate the effect or behavior I’m trying to replicate. I’m curious enough to try and figure it out myself if only I knew where to start looking, and what for. I just don’t know how his behavior is called in order to Google it.