// HD images if (windows.devicePixelRatio == 2) { Var = jQuery images ("img.hires"); // loop through the images and make them hi-res for (var i = 0; i <images.length; i ++) { // create a new image name var imageType = images (i) .src.substr (-4); var imageName = images (i) .src.substr (0, images (i) .src.length - 4); imageName + = "@ 2x" + imageType; // rename the image images (i) .src = imageName; } }
jQuery (& # 39; a.featured-image & # 39;). colorbox (); jQuery (& # 39;. colorbox & # 39;). colorbox (); jQuery (". content content (href $ = & # 39;. jpg & # 39;), a (href $ = & # 39;. png & # 39;), a (href $ = & # 39;. gif & # 39 😉 ") .boxbox (); jQuery (& # 39; .- content .gallery a & # 39;). colorbox ({rel: & # 39; gallery & # 39;});
// IE9 capture text jQuery (& # 39; input, textarea & # 39;).
// add content menu items jQuery (jQuery (& # 39; # content-anchor-internal & # 39;). get (& # 39;. content-class-divider & # 39;). get (). reverse ()). (()) var id = jQuery (this) .attr (& # 39; id & # 39;); var label = jQuery (this) .data (& # 39; label & # 39;); jQuery (& # 39; # content-anchor-wrapper & # 39;) .After (& # 39;
& # 39;); });
var fromTop = 119; // attach scrolls jQuery (& # 39; body & # 39;) .crcrpy ({target: & # 39; .contents-menu & # 39 ;, offset: fromTop});
// tasks that need to run after clicking ajax buttons dynamicElements ();
// navigation menu fx menuHovers ();
});
// is used for objects inside ajax panels functionical function () { // portholes mouseovers jQuery (". portholes .porthole-link"). hover ( function () { jQuery (this) .siblings (". color color"). Stop (). animated ({ & # 39; opacity & # 39;: & # 39; 8 & # 39; }, 150); jQuery (this) .siblings (". porthole-layer"). Stop (). animate ({ & # 39; opacity & # 39;: & # 39; 0 & # 39; }, 350); jQuery (this) .siblings (". porthole-info"). get (". rating-wrapper"). Stop (). animate ({ & # 39; opacity & # 39;: & # 39; 9 & # 39; }, 100); jQuery (this) .siblings (". porthole-info"). Stop (). Delay. (0) .queue (function (next) { jQuery (this) .addClass ("active"); Next (); }); }, function () { jQuery (this) .siblings (". color color"). Stop (). animated ({ & # 39; opacity & # 39;: & # 39; 0 & # 39; }, 550); jQuery (this) .siblings (". porthole-layer"). Stop (). animate ({ & # 39; opacity & # 39;: & # 39; 9 & # 39; }, 250); jQuery (this) .siblings (". porthole-info"). get (". rating-wrapper"). Stop (). animate ({ & # 39; opacity & # 39;: & # 39; 0 & # 39; }, 550); jQuery (this) .siblings (". porthole-info"). Stop (). Delay. (150) .queue (function (next) { jQuery (this) .removeClass ("active"); Next (); }); } ); // active hover jQuery (". add-active"). function () { jQuery (this) .addClass ("active"); }, function () { jQuery (this) .removeClass ("active"); } ); // to move the image jQuery ("active image"). function () { jQuery (this) .find (& # 39; img & # 39;). Stop (). animate ({opacity: .4}, 150); }, function () { jQuery (this) .find (& # 39; img & # 39;). Stop (). animate ({opacity: 1.0}, 500); } ); jQuery (".content"). function () { jQuery (this) .find (& # 39; img & # 39;). Stop (). animate ({opacity: .4}, 150); }, function () { jQuery (this) .find (& # 39; img & # 39;). Stop (). animate ({opacity: 1.0}, 500); } ); // jQuery tools jQuery (& # 39;. info & # 39;) .tiptip (); jQuery (& # 39;. info-top & # 39;) .tiptip (); jQuery (& # 39;. info-low & # 39;) .tiptiptip ((placement: & # 39; low & # 39;}); jQuery (& # 39;. info-left & # 39;) .tiptiptip ((placement: & # 39; left & # 39;}); jQuery (& # 39;. info-right & # 39;) .tiptiptip ((placement: & # 39; right & # 39;}); // popovers jQuery jQuery (& # 39;. popthis & # 39;). popover (); // jQuery crowdfunding jQuery (". alert") alert (); // jQuery fitvids jQuery (& # 39;. video_frame & # 39;). fitVids (); // columns of equal height equHeightColumns (jQuery (". widget-widget"); equHeightColumns (jQuery (". loop.grid .article-panel")); // when items are added firmly to the page load, need to respond with a new range resizeContentsMenu (); resizeStickyMenu (); }
// call the same height columns when the window is rebuilt jQuery (window) .resize (function () { equHeightColumns (jQuery (". widget-widget"); equHeightColumns (jQuery (". loop.grid .article-panel")); resizeContentsMenu (); resizeStickyMenu (); });
// call equal height columns when widgets have been re-expanded jQuery ("# widgets)) increase size (function (e) { equHeightColumns (jQuery (". widget-widget"); });
// call the same height columns when the main menu items are drawn there in the sub menus // is hidden and has no extensions until it appears jQuery (& # 39; body & # 39;) in (& # 39; mouseover & # 39 ;, & # 39; # category-menu-full a.parent-item & # 39 ;, function (e) { equHeightColumns (jQuery ("# category-menu-full ul.term-list, # category-menu-full li.post-list"), of course); }); // columns of equal height function equal HeightColumns (group, olimit) { long = 0; width = jQuery (window). width (); group.each (function () { jQuery (this) .removeAttr (& # 39; style & # 39;); thisHeight = jQuery (this). light (); if (thisHeight>) long = loHeight; } }); if (width> 991 "https://www.somosxbox.com/" nolimit) { group.height (too long); } }
var topOffset = 70; var barOffset = 208;
jQuery (window) .scroll (function () { if (jQuery (this) .scrollTop ()> 110) { jQuery (& # 39; # sticky-bar & # 39;). AddClass (& # 39; fixed & # 39;); jQuery (& # 39; # sticky-bar.logo-slide .logo a & # 39;). Stop (). animate ({opacity: 1.0, left: & # 39; 0px & # 39;}, 100); } else { if (! jQuery (& # 39; # sticky-menu & # 39;). ((visible)) &&! jQuery (& # 39; # category-menu-mobile & # 39;). ((: visible))) { jQuery (& # 39; # sticky-bar & # 39;). removeClass (& # 39; modified & # 39;); jQuery (& # 39; # sticky-bar.logo-slide .logo a & # 39;). Stop (). animate ({opacity: 0, left: & # 39; -100px & # 39;}, 500); } } if (jQuery (this) .scrollTop ()> 44) { jQuery (& # 39; # sticky-bar & # 39;). AddClass (& # 39; sticky-mobile & # 39;); } else { jQuery (& # 39; # sticky-bar & # 39;). UninstallClass (& # 39; sticky-mobile & # 39;); }
// move it back to the up arrow if (jQuery (this) .scrollTop () < 150) { jQuery("#back-to-top").fadeOut(); } else { jQuery("#back-to-top").fadeIn(); } resizeContentsMenu(); resizeStickyMenu(); }); function resizeStickyMenu() { //see if compact versions of menus should be shown if(jQuery('#section-menu-full').length > 0) { var megaWidth = jQuery (& # 39;. mega-menu & # 39;). width (); if (jQuery (& # 39;. mega-menu & # 39;). == 0) { var megaWidth = jQuery (& # 39; .- non-mega-menu & # 39;). width (); } var standardWidth = jQuery (& # 39; second-full menu & # 39;). width (); var compactWidth = jQuery (& # 39;. secondary-menu-compact & # 39;). wide (); var menusWidth = megaWidth + standardWidth; var compactMenusWidth = megaWidth + compactWidth; var logoWidth = jQuery (& # 39; # stick-bar. log & # 39;) width (); // var logoLeft = jQuery (& # 39; # sticky. .gogo & # 39;). offset (); // logoWidth = logoWidth + logoLeft.left; var newWidth = jQuery (& # 39; # new-articles & # 39;) width (); var stickyWidth = jQuery (& # 39; # sticky-menu-selected & # 39;) width (); var randomWidth = jQuery (& # 39; # random article & # 39;) width (); var controlWidth = jQuery (& # 39; # attachments-control & # 39;) width (); var barWidth = jQuery (& # 39; # sticky-bar> .row> .col-md-12> .container & # 39;). width (); if (barWidth === null) barWidth = jQuery (& # 39; # stick-bar> .row> .col-xs-12> .container & # 39;) width (); var extraWidth = logoWidth + newWidth + stickyWidth + randomWidth + controlsWidth; var limitedWidth = barWidth - extraWidth; // alert (& # 39; megaWidth = & # 39; + megaWidth + & # 39; nstandardWidth = & # 39; + standardWidth + & # 39; nmenusWidth = & # 39; + menusWidth + & # 39; nlogoWidth = & # 39; + logoWidth + & # 39; haswWthth = & # 39; + newWidth + & # 39; nstickyWidth = & # 39; + sticky + & # 39; nrandomWidth = & # 39; + randomWidth + & # 39; ncontrolsWidth = & # 39; + controlsWidth + & # 39; nbarWidth = & # 39; + barWidth + & # 39; nextraWidth = & # 39; + extraWidth + & # 39; nlimitWidth = & # 39; + limitWidth); The mega menu only exceeds the limit if (megaWidth> limitWidth) { jQuery (& # 39; # category-menu-full & # 39;). arrive (); jQuery (& # 39; # category-menu-compact & # 39;). show (); } // standard menu alone exceeds limit if (standardWidth> limitWidth) { jQuery (& # 39;. second-full menu & # 39;). arrive (); jQuery (& # 39;. secondary-menu-compact & # 39;). show (); } // both menus bypass the limit if (menusWidth> limitWidth) { // first minimizes the standard menu jQuery (& # 39;. second-full menu & # 39;). arrive (); jQuery (& # 39;. secondary-menu-compact & # 39;). show (); // The limit of the standard compiler menu composite menu if (compactMenusWidth> limitWidth) { jQuery (& # 39; # category-menu-full & # 39;). arrive (); jQuery (& # 39; # category-menu-compact & # 39;). show (); } } } }
function sizeContentsMenu () { // bookmark position if (jQuery (& # 39;. content-menu-default & # 39;) length> 0) { var menuOffset = jQuery (& # 39 ;.-menu-boat row & # 39;). offset (). top - topOffset; var newWidth = jQuery (& # 39;. content-menu-boat & # 39;) width () - 2; var btnWidth = jQuery (& # 39;. content-menu-wrap ul.sort-buttons & # 39;). width (); var lblWidth = jQuery (& # 39;. content-menu-wrap .bar-label-wrapper & # 39;). width (); var wrapperWidth = jQuery (& # 39; # great content & # 39;). width () - 2; var barWidth = btnWidth + lblWidth; if (barWidth> wrapperWidth) { jQuery (& # 39;. content-menu-default & # 39;). AddClass (& # 39; vertical & # 39;); } if (! jQuery (& # 39; .- context menu-boat storage & # 39;). hasClass (& # 39; vertical & # 39;) && jQuery (this) .scrollTop ()> menuOffset) { jQuery (& # 39;. menu contents & # 39;). AddClass (& # 39; fixed & # 39;) width (newWidth); } else { jQuery (& # 39;. menu contents & # 39;). DeleteClass (& # 39; modified & # 39;). deleteAttr (& # 39; style & # 39;); } // show menu after scroll and hide later (only vertically) if (jQuery (& # 39;. content-menu-full & # 39;). hasClass (& # 39; vertical & # 39;)) { if (! jQuery (& # 39; .- content-menu-storage & # 39;). ((visible))) { jQuery (& # 39;. content-menu-green & # 39;). stop (). fadeIn (100); } } } if (jQuery (& # 39;. content-menu-full & # 39;). hasClass (& # 39; vertical & # 39;)) { var newOffset = 68; jQuery (& # 39; body & # 39;) data.) (& # 39; bs.scrollpy & # 39;). options.offset = newOffset; // Set up new setup jQuery (& # 39; body & # 39;) Data () (& # 39; bs.scrcrpy & # 39;). process (); // Press scrolls to re-measure the property in your test jQuery (& # 39; body & # 39;) .crcrpy (& # 39; refresh & # 39;); // Restart the scroll. } }
// when disqus is working we have been working to fix the link connection from the comment to the disqus thread function disqusContentsMenu () { if (jQuery ("# disqus_thread") length> 0) { jQuery ("# views-anchor-wrapper a"). interesting ("href", "#disqus_thread"); } }
// hide context menu 2 seconds after scrolling has stopped (function () { var timer; jQuery (window) .bind (& # 39; scroll & # 39 ;, function () { clearTimeout (timer); timer = setTimeout (refresh, 1800); }); rip = function () { // only want to do this in vertical style and only if the mouse does not currently fit the menu if (jQuery (& # 39;. content-menu-storage & # 39;). hasClass (& # 39; vertical & # 39;) && jQuery (& # 39 ;. content-menu-screen: hover & # 39;) . = = 0) { jQuery (& # 39;. content-menu-woven & # 39;). fadeOut (1200); } }; }) ();
// hide the context menu after the married user (function () { var timer; jQuery (& # 39; body & # 39;) in (& # 39; mouseenter & # 39 ;, & # 39; .contents-menu-wrapper.vertical & # 39 ;, function (e) { jQuery (& # 39;. content-menu-store & # 39;). set (true, true) .fadeIn (100); clearTimeout (timer); }); jQuery (& # 39; body & # 39;) in (& # 39; mouseleave & # 39 ;, & # 39; .contents-menu-wrapper.vertical & # 39 ;, function (e) { clearTimeout (timer); timer = setTimeout (refresh, 1800); }); rip = function () { // only want to do this in vertical style and only if the mouse does not currently fit the menu if (jQuery (& # 39;. content-menu-storage & # 39;). hasClass (& # 39; vertical & # 39;) && jQuery (& # 39 ;. content-menu-screen: hover & # 39;) . = = 0) { jQuery (& # 39;. content-menu-woven & # 39;). fadeOut (1200); } }; }) ();
/ ** * See href to find anchor. If available, and in the document, scroll to it. * If the href argument is stopped, it is assumed in context (this) by HTML Element, * which will be if requested by jQuery after the event * / function scroll_if_anchor (href) { href = Typeof (href) == "string"? href: jQuery (this) .attr ("href");
// don't interrupt bootstrap carousels if (jQuery (href) .length> 0 &&! jQuery (this) .hasClass (& # 39; no scroll & # 39;)) { var fromTop = 118;
// remove the context menu height (and tags) if (jQuery (& # 39;. content-menu-full & # 39;). hasClass (& # 39; vertical & # 39;)) { fromTop = fromTop - 51; }
// If our Href points to a valid, empty anchor, and on the same page (e.g. #Foo) // Legacy jQuery and IE7 may have issues: http://stackoverflow.com/q/1593174 if (href.indexOf ("#") == 0) { var $ target = jQuery (href);
// An old browser other than pushState may be overrun here, as it is temporary // jump to the wrong place (IE < 10) if($target.length) { jQuery('html, body').animate({ scrollTop: $target.offset().top - fromTop }); if(history && "pushState" in history) { history.pushState({}, document.title, window.location.pathname + href); return false; } } } } } // When our page loads, check to see if it contains an anchor scroll_if_anchor(window.location.hash); // Intercept all anchor clicks jQuery("body").on("click", "a", scroll_if_anchor); //menu hovers function menuHovers() { jQuery(".menu .post-list a").hover( function() { jQuery(this).children('img').stop().animate({ opacity: .3 }, 150); }, function() { jQuery(this).children('img').stop().animate({ opacity: 1.0 }, 500); } ); } //new articles effects jQuery("#new-articles .selector").hover( function() { jQuery(this).addClass('over'); }, function() { jQuery(this).removeClass('over'); } ); jQuery("#new-articles .selector").click(function() { jQuery('#new-articles .post-container').animate({ height: 'toggle' }, 100, 'linear' ); jQuery(this).toggleClass('active'); }); //show search box jQuery("#menu-search-button").hover( function() { jQuery(this).toggleClass('hover'); } ); jQuery("#menu-search-button").click( function() { jQuery('#menu-search').fadeToggle("fast"); jQuery(this).toggleClass('active'); } ); //hide superfish more drop down on mobile if clicked again jQuery("#secondary-menu-selector").click( function() { if(jQuery('.secondary-menu-compact ul.menu').is(':visible')) { jQuery('.secondary-menu-compact ul.menu').hide(); } } ); //search form submission jQuery("#searchformtop input").keypress(function(event) { if (event.which == 13) { event.preventDefault(); var len = jQuery("#s").val().length; if(len >= 3) { jQuery ("# searchformtop"). submit (); } else { alert ("Search name must be at least 3 characters long"); } } }); // send email to send jQuery ("# feedburner_subscribe button"). click (function () { jQuery ("# feedburner_subscribe"). submit (); }); // show the entry form jQuery ("# sticky-login"). click (function () { jQuery (& # 39; # sticky-login-form & # 39;). animated ({ height: & # 39; Change & # 39; }, 100, & # 39; line & # 39;); jQuery (& # 39; # sticky-register-form & # 39;). arrive (); jQuery (& # 39; # sticky-register & # 39;). removeClass (& # 39; active & # 39;); jQuery (this) .toggleClass (& # 39; active & # 39;); }); // show the registration form jQuery ("# sticky-register"). click (function () { jQuery (& # 39; # sticky-register-form & # 39;). animated ({ height: & # 39; Change & # 39; }, 100, & # 39; line & # 39;); jQuery (& # 39; # sticky-login-form & # 39;). arrive (); jQuery (& # 39; # sticky-login)). DeleteClass (& # 39; active & # 39;); jQuery (this) .toggleClass (& # 39; active & # 39;); }); // to move the hover button results jQuery (". sticky import"). hover (function () { jQuery (this) .toggleClass ("active"); }); // submission of entry form jQuery (". sticky-login #user_pass"). typypress (function (event) { if (event.which == 13) { jQuery ("# sticky-login. upload"). show (); jQuery ("form.sticky-login-form"). animate ({opacity: "0.15"}, 0); event.preventDefault (); jQuery (". sticky-entry-form"). submit (); } }); jQuery ("# sticky-login"). click (function () { jQuery ("# sticky-login. upload"). show (); jQuery ("form.sticky-login-form"). animate ({opacity: "0.15"}, 0); jQuery (". sticky-entry-form"). submit (); }); // register the form submission jQuery (".-register-form #user_email"). typypress (function (event) { if (event.which == 13) { jQuery ("# sticky-register-form. upload"). show (); jQuery ("form.sticky-register-form"). animate ({opacity: "0.15"}, 0); event.preventDefault (); jQuery (".-register-register-form"). submit (); } }); jQuery ("# sticky-registration-submission"). click (function () { jQuery ("# sticky-register-form. upload"). show (); jQuery ("form.sticky-register-form"). animate ({opacity: "0.15"}, 0); jQuery (".-register-register-form"). submit (); }); // hide and check password message jQuery (".expect password"). click (function () { jQuery (this) .animate ({ height: & # 39; Change & # 39; }, 100, & # 39; line & # 39;); }); // scroll all #top items up jQuery ("a (href = & # 39; # top & # 39;)"). click (function () { jQuery ("html, body") animate ({scrollTop: 0}, "slow"); return false; }); // image is black jQuery (& # 39; body & # 39;) in (& # 39; mouseenter & # 39 ;, & # 39; .darken & # 39 ;, function (e) { jQuery (this) .find (& # 39; img & # 39;). Stop (). animate ({opacity: .4}, 150); }) in (& # 39; mouseleave & # 39 ;, & # 39; .darken & # 39 ;, function (e) { jQuery (this) .find (& # 39; img & # 39;). Stop (). animate ({opacity: 1.0}, 500); }); // reaction of mice jQuery (& # 39; body & # 39;) in (& # 39; mouseenter & # 39 ;, & # 39; .reaction.clickable & # 39 ;, function (e) { jQuery (this) .addClass (& # 39; active & # 39;); }) in (& # 39; mouseleave & # 39 ;, & # 39; .reaction & # 39 ;, function (e) { jQuery (this) .removeClass (& # 39; active & # 39;); }); // user rating indicator // user comment comment indicator jQuery (& # 39; body & # 39;) in (& # 39; mouseover & # 39 ;, & # 39; #contact .rating-wrapper.rateable & # 39 ;, function (e) { jQuery (this) .addClass (& # 39; more & # 39;); jQuery (this) .find (& # 39;. form-Selector-wrapper & # 39;). fadeIn (100); }); jQuery (& # 39; body & # 39;) in (& # 39; mouseleave & # 39 ;, & # 39; #contact .rating-wrapper & # 39 ;, function (e) { jQuery (this) .stop (). delay (100) .queue (function (n) { jQuery (this) .removeClass (& # 39; more & # 39;); n (); }); jQuery (this) .find (& # 39;. form-Selector-wrapper & # 39;). Stop (). fadeOut (500); }); // user comment rate jQuery ("#XT .form-Selector") .on ("slidestop", function (event, ui) { var divID = jQuery (this) .parent (). parent (). parent (). fascin ("id"); var rating = jQuery (this) .parent (). siblings (& # 39;. rating-value & # 39;). html (); jQuery (& # 39; # & # 39; + divID + & # 39; .theme-icon-check & # 39;). delay (100) .fadeIn (100); jQuery (& # 39; # & # 39; + divID + & # 39;. -fix-rate-value & # 39;). val (to measure); });
// pinterest if (jQuery (& # 39; # pinterest-social-tab & # 39;) height> 0) { (function (d) { var f = d.getElementsByTagName (& # 39; SCRIPT & # 39;) (0), p = d.createElement (& # 39; SCRIPT & # 39;); p.type = & # 39; text / javascript & # 39 ;; p.async = true; p.src = "https://assets.pinterest.com/js/pinit.js"; f.parentNode.insertBefore (p, f); } (document)); }
// facebook if (jQuery (& # 39; # facebook-social-tab & # 39; length> 0) { (function (d, s, id) { var js, fjs = d.getElementsByTagName (s) (0); if (d.getElementById (id)) return; js = d.createElement (s); js.id = id; js.src = "https://connect.facebook.net/en_US/all.js#xfbml=1&status=0"; fjs.parentNode.insertBefore (js, fjs); } (document, & # 39; script & # 39 ;, & # 39; facebook-jssdk & # 39;); }
//WINDOW.LOAD jQuery (window) .load (function () {
// flickr if (jQuery (& # 39; # flickr-social-tab & # 39; length> 0) { jQuery (& # 39;. flickr & # 39;) .jflickrfeed ({ limit: 9, Symptoms: { id: "https://www.somosxbox.com/" }, itemTemplate: & # 39;
& # 39; }, function (data) { }); }
// tabs - these should be entered via windows.load so that pinterest will work within the tab jQuery (& # 39;. widgets-plus .it-social-tabs & # 39;). tabs ({fx: {opacity: & # 39; toggle & # 39 ;, dude: 150}}); jQuery (& # 39; # footer .it-social-tabs & # 39;). tabs ({active: 2, fx: {opacity: & # 39; toggle & # 39 ;, height: 150}}); jQuery (& # 39;. share-wrapper & # 39;). show (); equHeightColumns (jQuery (". loop.grid .article-panel")); disqusContentsMenu ();
// show ads after mmenu setup because it wraps the page with div // causing google adsense to reload jQuery (& # 39;. it-ad & # 39;). animate ({opacity: & # 39; 1 & # 39;}, 0);
});
jQuery.noConflict ();