| Server IP : 27.254.86.99 / Your IP : 216.73.216.234 Web Server : LiteSpeed System : Linux wp1.hostneverdie.com 4.18.0-553.46.1.lve.el8.x86_64 #1 SMP Wed Apr 2 11:16:45 UTC 2025 x86_64 User : qtccargo ( 1078) PHP Version : 8.2.29 Disable Function : apache_child_terminate, apache_setenv, define_syslog_variables, escapeshellarg, escapeshellcmd,exec, fp, fput, highlight_file, ini_alter, ini_restore, inject_code, passthru,phpAds_remoteInfo, phpAds_XmlRpc,phpAds_xmlrpcDecode, phpAds_xmlrpcEncode, popen, posix_getpwuid, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid,posix_setuid, posix_setuid, posix_uname,proc_open,proc_close, proc_get_status, proc_nice, proc_terminate, shell_exec, syslog, system, xmlrpc_entity_decode, show_source,pcntl_exec,virtual,suexec,dbmopen,dl,disk_free_space,diskfreespace,leak MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/qtccargo/domains/iamumbrella.com/public_html/wp-content/themes/soledad/js/ |
Upload File : |
(function($) {
$.fn.extend({
stickyMojo: function(options) {
// Exit if there are no elements to avoid errors:
if (this.length === 0) {
return this;
}
var settings = $.extend({
'footerID': '',
'contentID': '',
'orientation': $(this).css('float')
}, options);
var sticky = {
'el': $(this),
'stickyLeft': $(settings.contentID).outerWidth() + $(settings.contentID).offset.left,
'stickyTop2': $(this).offset().top,
'stickyHeight': $(this).outerHeight(true),
'contentHeight': $(settings.contentID).outerHeight(true),
'win': $(window),
'breakPoint': $(this).outerWidth(true) + $(settings.contentID).outerWidth(true),
'marg': parseInt($(this).css('margin-top'), 10)
};
var errors = checkSettings();
cacheElements();
return this.each(function() {
buildSticky();
});
function buildSticky() {
if (!errors.length) {
sticky.el.css('left', sticky.stickyLeft);
sticky.win.bind({
'load': stick,
'scroll': stick,
'resize': function() {
sticky.el.css('left', sticky.stickyLeft);
stick();
}
});
} else {
if (console && console.warn) {
console.warn(errors);
} else {
alert(errors);
}
}
}
// Caches the footer and content elements into jquery objects
function cacheElements() {
settings.footerID = $(settings.footerID);
settings.contentID = $(settings.contentID);
}
// Calcualtes the limits top and bottom limits for the sidebar
function calculateLimits() {
return {
limit: settings.footerID.offset().top - sticky.stickyHeight,
windowTop: sticky.win.scrollTop(),
stickyTop: sticky.stickyTop2 - sticky.marg
}
}
// Sets sidebar to fixed position
function setFixedSidebar() {
sticky.el.addClass('is-sticky').css({
position: 'fixed',
top: 0,
width: sticky.el.outerWidth()+'px',
});
}
// Determines the sidebar orientation and sets margins accordingly
function checkOrientation() {
if (settings.orientation === "left") {
settings.contentID.css('margin-left', sticky.el.outerWidth(true));
} else {
sticky.el.css('margin-left', settings.contentID.outerWidth(true));
}
}
// sets sidebar to a static positioned element
function setStaticSidebar() {
sticky.el.removeClass('is-sticky').css({
'position': 'static',
'margin-left': '0px'
});
settings.contentID.css('margin-left', '0px');
}
// initiated to stop the sidebar from intersecting the footer
function setLimitedSidebar(diff) {
sticky.el.css({
top: diff
});
}
//determines whether sidebar should stick and applies appropriate settings to make it stick
function stick() {
var tops = calculateLimits();
var hitBreakPoint = tops.stickyTop < ( tops.windowTop + 55 ) && (sticky.win.width() >= sticky.breakPoint);
if (hitBreakPoint) {
setFixedSidebar();
checkOrientation();
} else {
setStaticSidebar();
}
if (tops.limit < tops.windowTop) {
var diff = tops.limit - tops.windowTop;
setLimitedSidebar(diff);
}
}
// verifies that all settings are correct
function checkSettings() {
var errors = [];
for (var key in settings) {
if (!settings[key]) {
errors.push(settings[key]);
}
}
ieVersion() && errors.push("NO IE 7");
return errors;
}
function ieVersion() {
if(document.querySelector) {
return false;
}
else {
return true;
}
}
}
});
})(jQuery);