zuk / jquery.inview

Remy Sharp's jQuery plugin adds a bindable 'inview' event for detecting when an element is scrolled into view.
http://remysharp.com/2009/01/26/element-in-view-event-plugin/
Other
277 stars 587 forks source link

offset #9

Open markimark opened 10 years ago

markimark commented 10 years ago

Hi Jed, how is California going?

I appreciate the work you have done for the inview plugin, because it is so very helpful to fire css3 animation, on onepage websites, only if the object is in view. Without such a feature, no one ever would see those animations, right?

I have a question. Right now the class is added as soon as the top of the object is hitting the bottom of the screen. How can I make it to add the class only if 50% of that object is already seen?

Can you help me to achieve this?

Cheers from Berlin, Germany

Mark

jednano commented 10 years ago

Not a fan of Los Angeles. I can say that much.

I think you're the 2nd person to ask about the 50% in-view, but I'm afraid there is no solution for this in this plug-in. You might, however, be able to fake it by using a negative value for data-offset. So, if you want it to fire it 200 pixels from the top, give it a data-offset="-200". No idea if this will work, but give that a try and tell me how it goes.

markimark commented 10 years ago

Hi ;-)

unfortunately it did not work. Isn't something possible like saying windowHeight / 0.8 (no idea where exactly to say this but....), you know what I mean? To fake a smaller height, wouldn't that make more of the object appear before it fires? Just a thought, I am not good at this, so this might be totally out of the question :-(((

On Fri, Sep 20, 2013 at 6:05 PM, Jed Hunsaker notifications@github.comwrote:

Not a fan of Los Angeles. I can say that much.

I think you're the 2nd person to ask about the 50% in-view, but I'm afraid there is no solution for this in this plug-in. You might, however, be able to fake it by using a negative value for data-offset. So, if you want it to fire it 200 pixels from the top, give it a data-offset="-200". No idea if this will work, but give that a try and tell me how it goes.

— Reply to this email directly or view it on GitHubhttps://github.com/zuk/jquery.inview/issues/9#issuecomment-24821163 .

Skype: markimark.web Mobile: +4915114432691 Office: +493037301858 Email: mark(at)mark-i-mark.com

jednano commented 10 years ago

Well, it's always possible, but it's not a feature of this plug-in, so it would have to be a feature request or someone would have to fork the repo to add said functionality.