Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions jquery.appear.min.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* jQuery appear plugin
*
* Copyright (c) 2012 Andrey Sidorov
* licensed under MIT license.
*
* https://github.com/morr/jquery.appear/
*
* Version: 0.3.3
*/
!function(a){function h(){d=!1;for(var c=0,e=b.length;e>c;c++){var f=a(b[c]).filter(function(){return a(this).is(":appeared")});if(f.trigger("appear",[f]),g){var h=g.not(f);h.trigger("disappear",[h])}g=f}}var g,b=[],c=!1,d=!1,e={interval:250,force_process:!1},f=a(window);a.expr[":"].appeared=function(b){var c=a(b);if(!c.is(":visible"))return!1;var d=f.scrollLeft(),e=f.scrollTop(),g=c.offset(),h=g.left,i=g.top;return i+c.height()>=e&&i-(c.data("appear-top-offset")||0)<=e+f.height()&&h+c.width()>=d&&h-(c.data("appear-left-offset")||0)<=d+f.width()?!0:!1},a.fn.extend({appear:function(f){var g=a.extend({},e,f||{}),i=this.selector||this;if(!c){var j=function(){d||(d=!0,setTimeout(h,g.interval))};a(window).scroll(j).resize(j),c=!0}return g.force_process&&setTimeout(h,g.interval),b.push(i),a(i)}}),a.extend({force_appear:function(){return c?(h(),!0):!1}})}(jQuery);