diff --git a/README.md b/README.md index adb157b..9b1249e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Element 'inview' Event Plugin -Event that is fired as soon as an element appears in the user's viewport. +Event that is fired when an element enters or leaves the user's viewport. * **Author:** [Christopher Blum](http://twitter.com/ChristopherBlum) * **Original idea and concept by:** [Remy Sharp](http://remysharp.com/2009/01/26/element-in-view-event-plugin/) diff --git a/bower.json b/bower.json index 652cbcd..b1e7eb9 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { - "name": "protonet.jquery.inview", - "version": "1.1.2", + "name": "ch.crafft.jquery.inview", + "version": "1.1.3-crafft", "main": "jquery.inview.js", "description": "jQuery event that is fired as soon as an element appears in the user's viewport." -} \ No newline at end of file +} diff --git a/jquery.inview.js b/jquery.inview.js index b4aa399..a1e6415 100644 --- a/jquery.inview.js +++ b/jquery.inview.js @@ -123,7 +123,7 @@ if (!inView) { $element.data('inview', true).trigger('inview', [true]); } - } else if (inView) { + } else if (inView || typeof inView === 'undefined') { $element.data('inview', false).trigger('inview', [false]); } } diff --git a/jquery.inview.min.js b/jquery.inview.min.js index cbf1c30..aa74be7 100644 --- a/jquery.inview.min.js +++ b/jquery.inview.min.js @@ -1 +1 @@ -!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){function i(){var b,c,d={height:f.innerHeight,width:f.innerWidth};return d.height||(b=e.compatMode,(b||!a.support.boxModel)&&(c="CSS1Compat"===b?g:e.body,d={height:c.clientHeight,width:c.clientWidth})),d}function j(){return{top:f.pageYOffset||g.scrollTop||e.body.scrollTop,left:f.pageXOffset||g.scrollLeft||e.body.scrollLeft}}function k(){if(b.length){var e=0,f=a.map(b,function(a){var b=a.data.selector,c=a.$element;return b?c.find(b):c});for(c=c||i(),d=d||j();ed.top&&l.topd.left&&l.leftr.top&&c.topr.left&&c.left