This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function mouseMoving(element, movementSpeed = 1) { | |
| if (typeof element == 'string') { | |
| element = $(element); | |
| }; | |
| element.css({ | |
| 'position': 'relative' | |
| }); | |
| $(document).on('mousemove', function(event) { | |
| let x = event.pageX * 100 / $(document).innerWidth(); | |
| let y = event.pageY * 100 / $(document).innerHeight(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, minimum-scale=1.0, user-scalable=yes, shrink-to-fit=no"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function ajaxGetStatusOfLinks(arrayOfLinks) { | |
| if (typeof arrayOfLinks == 'string') { | |
| arrayOfLinks = [arrayOfLinks]; | |
| }; | |
| let returnObjs = []; | |
| arrayOfLinks.forEach(function(link, i) { | |
| let xhttp = new XMLHttpRequest(); | |
| xhttp.onreadystatechange = function() { | |
| if (this.status == 200 && this.readyState == 4) { | |
| returnObjs.push({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function waitBy(byThis, diffThis = 'undefined', maxWait = 10000){ | |
| return new Promise(function(resolve, reject){ | |
| if( typeof byThis == 'string' ){ | |
| let waitPromise = setInterval(function(){ | |
| if( typeof top[byThis] != diffThis ){ | |
| clearInterval(waitPromise); | |
| resolve(true); | |
| }; | |
| }, 10); | |
| let waitPromiseReject = setTimeout(function(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| new Promise(function(resolve, reject){ | |
| setTimeout(function(){ | |
| resolve(true); | |
| }, 5000); | |
| setTimeout(function(){ | |
| resolve(false); | |
| }, 10000); | |
| }).then(function(val){ | |
| if(val == true){ | |
| //... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* https://getbootstrap.com/docs/4.0/layout/grid/ */ | |
| .no-gutters { | |
| margin-right: 0; | |
| margin-left: 0; | |
| } | |
| .no-gutters > .col, | |
| .no-gutters > [class*='col-']{ | |
| padding-right: 0; | |
| padding-left: 0; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jQuery.fn.extend({ | |
| indexOf: function(selector) { | |
| let thisElement = $(this); | |
| if ($(this).constructor == $().constructor) { | |
| if (typeof selector == 'undefined') { | |
| return $(this).index(); | |
| }; | |
| if (!$(this).is(selector)) { | |
| console.error('This element is not equal to the selector.'); | |
| return stopError; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jQuery.fn.extend({indexOf:function(a){let b=$(this);if($(this).constructor==$().constructor){if('undefined'==typeof a)return $(this).index();if(!$(this).is(a))return console.error('This element is not equal to the selector.'),stopError;let c=-1;return $(this).parent().children().each(function(){if($(this).is(a)&&c++,$(this).is(b))return!1}),c}return console.error('The "indexOf" function only accepts jquery elements.'),stopError}}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function offset(element, diffInTop, diffInLeft){ | |
| return element.offset(diffInTop, diffInLeft); | |
| }; | |
| Object.prototype.offset = function(element, diffInTop, diffInLeft){ | |
| if( typeof diffInLeft == 'undefined' ){diffInLeft = 0;}; | |
| if( typeof diffInTop == 'undefined' ){diffInTop = 0;}; | |
| if( typeof element == 'undefined' ){element = 0;}; | |
| if( this != window ){ | |
| diffInLeft = diffInTop; |