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 586 forks source link

does this work with Jquery 2.1? #11

Closed ewassef closed 4 years ago

ewassef commented 10 years ago

$.cache seems to always be null and no events fire. is it not compatible anymore?

Thanks

zuk commented 10 years ago

Sounds like it might not be. Would be great if someone had a look and figured out if there's a way to make the plugin compatible.

tomaszrondio commented 9 years ago

it is pretty easy.

around line 50 remove:

$.each($._data, function() {
  if (this.events && this.events.inview) {
    elems.push(this.handle.elem);
  }
});

and replace:

$(elems).each()...

with:

$('.inview').each()...

it requires that every element that should be watched has to have inview class.

magixx commented 9 years ago

Still broken for me on 2.1.1 and latest. See http://jsbin.com/kaburov/edit?html,css,js,console,output