Skip to Content

JavaScript File

URL: https://www.tantrafuengirola.com/wp-content/themes/aviana/assets/js/modules/plugins/parallax.min.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: 2 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 Plugin: jQuery Parallax

3 Version 1.1.3

4 Author: Ian Lunn

5 Twitter: @IanLunn

6 Author URL: http://www.ianlunn.co.uk/

7 Plugin URL: http://www.ianlunn.co.uk/plugins/jquery-parallax/

8

9 Dual licensed under the MIT and GPL licenses:

10 http://www.opensource.org/licenses/mit-license.php

11 http://www.gnu.org/licenses/gpl.html

12 */

13(function( $ ){"use strict"; var $window = $(window); var windowHeight = $window.height(); $window.resize(function () {windowHeight = $window.height(); }

14); $.fn.parallax = function(xpos, speedFactor, outerHeight) {var $this = $(this); var getHeight; var firstTop; var paddingTop = 0; $this.each(function(){firstTop = $this.offset().top; }

15); if (outerHeight) {getHeight = function(jqo) {return jqo.outerHeight(true); }

16; }

17 else {getHeight = function(jqo) {return jqo.height(); }

18; }

19 if (arguments.length < 1 || xpos === null) xpos = "50%"; if (arguments.length < 2 || speedFactor === null) speedFactor = 0.1; if (arguments.length < 3 || outerHeight === null) outerHeight = true; function update(){var pos = $window.scrollTop(); $this.each(function(){var $element = $(this); var top = $element.offset().top; var height = getHeight($element); if (top + height < pos || top > pos + windowHeight) {return; }

20 $this.css('backgroundPosition', xpos + " " + Math.round((firstTop - pos) * speedFactor) + "px"); }

21); }

22 $window.bind('scroll', update).resize(update); update(); }

23; }

24)(jQuery);