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; .- menu-content-group & # 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-timer & # 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-timer & # 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;
// 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") insert ();
}
});
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") insert ();
});
// 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);
});
// tabs - these should be entered via windows.load so that pinterest will work within the tab
jQuery (& # 39;. wrapper-widgets .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);