jQuery(document).ready(function($){ var leftWidth = $(window).width() - 725; $('.left-column').css('min-width', leftWidth); $('.widget_search').find('.screen-reader-text').html('Укажите, что вы хотите поискать и нажмите «Найти»'); $('.side-column').mCustomScrollbar({ advanced:{ updateOnContentResize: true } }); if( $('.mCSB_container').height() < $(window).height() ) { $('.sidetop').hide(); $('.sidebottom').hide(); } $('.collapse-text').on('click', function(event) { $('.commentlist').slideUp(); $(this).fadeOut(); $('.expand-text').fadeIn(); }); $('.expand-text').on('click', function(event) { $('.commentlist').slideDown(); $(this).fadeOut(); $('.collapse-text').fadeIn(); }); $('.sidetop').on('click', function(event) { $('.side-column').mCustomScrollbar('scrollTo','top'); }); $('.sidebottom').on('click', function(event) { $('.side-column').mCustomScrollbar('scrollTo','bottom'); }); $('.sideslide').on('click', function(event) { if ( $(this).hasClass('closed') ) { $('.left-column').animate({'marginRight': '725px'}, 500); $('.side-column').animate({'width': '400px'}, 500); $('.sidecontrols').animate({'right': '726px'}, 500); $(this).html(''); } else { $('.left-column').animate({'marginRight': '325px'}, 500); $('.side-column').animate({'width': '0'}, 500); $('.sidecontrols').animate({'right': '326px'}, 500); $(this).html(''); } $(this).toggleClass('closed'); }); var heights = []; $('.stream-text').each(function(index, element){ heights.push($(element).height()); }); $('.stream-text').height( Math.max.apply(Math, heights) ); var heights1 = []; $('.archive .hentry').each(function(index, element){ heights1.push($(element).height()); }); $('.archive .hentry').height( Math.max.apply(Math, heights1) ); var heights2 = []; $('.search .hentry').each(function(index, element){ heights2.push($(element).height()); }); $('.search .hentry').height( Math.max.apply(Math, heights2) ); $('.home-article:first').before('
'); var articlesNumber = $('.home-article').length + 1; for ($i = 1; $i < articlesNumber; $i++) { var temp = $('.article-num-'+$i); if ($i % 2 === 0) { temp.detach().appendTo( $('.home-articles-right') ); } else { temp.detach().appendTo( $('.home-articles-left') ); } } });