AnonSec Team
Server IP : 10.131.40.8  /  Your IP : 216.73.216.37
Web Server : Apache
System : Linux webd008.cluster131.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
User : ludmqhh ( 137773)
PHP Version : 8.4.10
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0705) :  /home/l/u/d/ludmqhh/www/hotel-forum/wp-content/themes/hotello/public/js/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/l/u/d/ludmqhh/www/hotel-forum/wp-content/themes/hotello/public/js/parallax.js
"use strict";


(function ($) {
    var $window = $(window);
    var windowHeight = $window.height();

    $(window).on( "resize", function() {
        windowHeight = $window.height();
    });

    $.fn.parallax = function (xpos, speedFactor, outerHeight) {
        var $this = $(this);
        var getHeight;
        var firstTop;

        $this.each(function () {
            firstTop = $this.offset().top;
        });

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

        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;
                }

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

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

    $(window).on( "load", function() {
        "use strict";

        $('.stm-parallax').each(function () {
            var parallax_id = $(this).attr('data-parallax');
            $('.stm-parallax[data-parallax="' + parallax_id + '"' + ']').parallax("50%", 0.3);
        });
    });
})(jQuery);

AnonSec - 2021