Server IP : 173.249.157.85 / Your IP : 18.224.18.7 Web Server : Apache System : Linux server.frogzhost.com 3.10.0-1127.19.1.el7.x86_64 #1 SMP Tue Aug 25 17:23:54 UTC 2020 x86_64 User : econtech ( 1005) PHP Version : 7.3.33 Disable Function : NONE MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/econtech/public_html/public/back/assets/vendors/general/waypoints/src/shortcuts/ |
Upload File : |
(function() { 'use strict' var $ = window.jQuery var Waypoint = window.Waypoint /* http://imakewebthings.com/waypoints/shortcuts/sticky-elements */ function Sticky(options) { this.options = $.extend({}, Waypoint.defaults, Sticky.defaults, options) this.element = this.options.element this.$element = $(this.element) this.createWrapper() this.createWaypoint() } /* Private */ Sticky.prototype.createWaypoint = function() { var originalHandler = this.options.handler this.waypoint = new Waypoint($.extend({}, this.options, { element: this.wrapper, handler: $.proxy(function(direction) { var shouldBeStuck = this.options.direction.indexOf(direction) > -1 var wrapperHeight = shouldBeStuck ? this.$element.outerHeight(true) : '' this.$wrapper.height(wrapperHeight) this.$element.toggleClass(this.options.stuckClass, shouldBeStuck) if (originalHandler) { originalHandler.call(this, direction) } }, this) })) } /* Private */ Sticky.prototype.createWrapper = function() { if (this.options.wrapper) { this.$element.wrap(this.options.wrapper) } this.$wrapper = this.$element.parent() this.wrapper = this.$wrapper[0] } /* Public */ Sticky.prototype.destroy = function() { if (this.$element.parent()[0] === this.wrapper) { this.waypoint.destroy() this.$element.removeClass(this.options.stuckClass) if (this.options.wrapper) { this.$element.unwrap() } } } Sticky.defaults = { wrapper: '<div class="sticky-wrapper" />', stuckClass: 'stuck', direction: 'down right' } Waypoint.Sticky = Sticky }())