Skip to Content

JavaScript File

URL: https://www.tantrafuengirola.com/wp-content/themes/aviana/assets/js/modules/plugins/jquery.appear.js?ver=6.1.1
HTTP Status: 200 OK
MIME Type: application/javascript
Last Modified: Mon, 04 Oct 2021 09:53:27 GMT
Download Time: Less than a second
Cookies: None
Size: 3 KB
HTTP Headers:  8 headers
Links In:  1 pages
Links Out:  0 links
Images:  0 images
CSS:  0 files
JavaScript:  0 files
OK Issues: No issues found

1/*

2 * jQuery.appear

3 * https://github.com/bas2k/jquery.appear/

4 * http://code.google.com/p/jquery-appear/

5 * http://bas2k.ru/

6 *

7 * Copyright (c) 2009 Michael Hixson

8 * Copyright (c) 2012-2014 Alexander Brovikov

9 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)

10 */

11(function($) {$.fn.appear = function(fn, options) {var settings = $.extend({data: undefined, one: true, accX: 0, accY: 0 }

12, options); return this.each(function() {var t = $(this); t.appeared = false; if (!fn) {t.trigger('appear', settings.data); return; }

13 var w = $(window); var check = function() {if (!t.is(':visible')) {t.appeared = false; return; }

14 var a = w.scrollLeft(); var b = w.scrollTop(); var o = t.offset(); var x = o.left; var y = o.top; var ax = settings.accX; var ay = settings.accY; var th = t.height(); var wh = w.height(); var tw = t.width(); var ww = w.width(); if (y + th + ay >= b && y <= b + wh + ay && x + tw + ax >= a && x <= a + ww + ax) {if (!t.appeared) t.trigger('appear', settings.data); }

15 else {t.appeared = false; }

16 }

17; var modifiedFn = function() {t.appeared = true; if (settings.one) {w.unbind('scroll', check); var i = $.inArray(check, $.fn.appear.checks); if (i >= 0) $.fn.appear.checks.splice(i, 1); }

18 fn.apply(this, arguments); }

19; if (settings.one) t.one('appear', settings.data, modifiedFn); else t.bind('appear', settings.data, modifiedFn); w.scroll(check); $.fn.appear.checks.push(check); (check)(); }

20); }

21; $.extend($.fn.appear, {checks: [], timeout: null, checkAll: function() {var length = $.fn.appear.checks.length; if (length > 0) while (length--) ($.fn.appear.checks[length])(); }

22, run: function() {if ($.fn.appear.timeout) clearTimeout($.fn.appear.timeout); $.fn.appear.timeout = setTimeout($.fn.appear.checkAll, 20); }

23 }

24); $.each(['append', 'prepend', 'after', 'before', 'attr', 'removeAttr', 'addClass', 'removeClass', 'toggleClass', 'remove', 'css', 'show', 'hide'], function(i, n) {var old = $.fn[n]; if (old) {$.fn[n] = function() {var r = old.apply(this, arguments); $.fn.appear.run(); return r; }

25 }

26 }

27); }

28)(jQuery);