This file contains 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 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
.wpb_custom_raw_html{ | |
border: 0; | |
padding: 0; | |
} | |
.wpb_custom_raw_html > .container{ | |
width: 100%; | |
padding: 0; | |
} | |
.wpb_custom_raw_html > .container > .wpb_column > div{ | |
padding: 0; |
This file contains 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 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 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://davidwalsh.name/detect-scrollbar-width */ | |
.scrollbar-y-measure{width:100px;height:100px;overflow:scroll;position:absolute;top:-9999px} |
This file contains 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
.btn:not(.btn-default):not(.btn-primary):not(.btn-success):not(.btn-info):not(.btn-warning):not(.btn-danger):not(.btn-link){ | |
background-color: rgba(0, 0, 0, 0); | |
white-space: normal; | |
} | |
.btn:focus:not(.btn-default):not(.btn-primary):not(.btn-success):not(.btn-info):not(.btn-warning):not(.btn-danger):not(.btn-link){ | |
box-shadow: none; | |
white-space: normal; | |
} |
This file contains 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
$('html, body').stop().animate({ | |
scrollTop: 0 | |
}, 1000); |
This file contains 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 getLocalJSON(objName) { | |
if (typeof objName == 'string') { | |
if (localStorage.getItem('objJSON-' + objName) !== null) { | |
let objValue = localStorage.getItem('objJSON-' + objName); | |
return JSON.parse(objValue); | |
} else { | |
return {}; | |
}; | |
}; | |
}; |
This file contains 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 setLocalJSON(objName, objValue) { | |
if (typeof objName == 'string') { | |
if (objValue.constructor == {}.constructor) { | |
localStorage.setItem('objJSON-' + objName, JSON.stringify(objValue)); | |
} else { | |
console.error('setLocalJSON accepts only json objects.'); | |
return false; | |
}; | |
}; | |
}; |