var window_cur_size = 'screen'; jQuery('document').ready(function(){ jQuery('.cont_vat_tab ul.content > li').filter(function() { return jQuery(this).css("display")!='none'}).addClass('active'); jQuery('#wd-categories-tabs > .tabs > li').eq(0).addClass('active'); sliderHeight=parseInt(jQuery("#slider-wrapper").height()); sliderWidth=parseInt(jQuery("#slider-wrapper").width()); sliderIndex=sliderHeight/sliderWidth; if(matchMedia('only screen and (max-width : 767px)').matches){ phone(); } else if (matchMedia('only screen and (min-width: 768px) and (max-width: 1024px)').matches){ tablet(); } else{checkMedia();} jQuery(window).resize(function(){checkMedia();}); function checkMedia(){ //################SCREEN if(matchMedia('only screen and (min-width: 1025px)').matches){screen();} //################TABLET if (matchMedia('only screen and (min-width: 768px) and (max-width: 1024px)').matches){tablet();} //################PHONE if(matchMedia('only screen and (max-width : 767px)').matches){phone(false);} if(typeof(wdwt_slider_resize)=='function'){ wdwt_slider_resize(); } } function screen(){ if(best_magazine_full_width){ screenSize='99%'; } else screenSize=best_magazine_content_width+ "%"; //w_w = jQuery(window).width() > screenSize ? screenSize : jQuery(window).width(); //jQuery(".container").css('width',''); //jQuery(".container").css('max-width',w_w+'px'); jQuery("#header .phone-menu-block").removeClass("container").css({width:"auto"}); //jQuery(".container").width(jQuery("body").attr("screen-size")); //jQuery("body header, body footer,#top-nav > div > ul,#top-nav > div > div > ul").not(".container").width("100%"); jQuery(".blog").css('width',''); sHeight=sliderIndex*parseInt(jQuery("#slider-wrapper").width()); sliderSize(sHeight); if(window_cur_size == 'phone'){ jQuery("#header").find("#menu-button-block").remove(); jQuery("#top-nav").css({"display":"block"}); jQuery("#top-nav").removeClass("open"); jQuery("#header-top .container").append(jQuery("#social")); jQuery("#header-middle").prepend(jQuery("#logo")); jQuery("aside .sidebar-container .widget-area").removeClass("clear"); jQuery(".top-posts-block").width("100%"); } if(window_cur_size == 'phone' || window_cur_size == 'tablet'){ jQuery("#top-nav > div > ul li.addedli,#top-nav > div > div > ul li.addedli").remove(); jQuery('#sidebar1').after(jQuery('#content')); jQuery('.added_not_exsisted_footer_sidbar').remove(); } var max_height=[]; jQuery('.cont_vat_tab ul.content> li').each(function(){ max_height.push(jQuery(this).height()); }) max_heightli = Math.max.apply(Math, max_height); jQuery('.cont_vat_tab ul.content').height(max_heightli); inserting_div_float_problem(jQuery('#sidebar-footer')); jQuery("#top-posts-contents-nav").css({"display":"none"}); window_cur_size = 'screen'; } function tablet(){ jQuery("#header .phone-menu-block").removeClass("container").css({width:"auto"}); //w_w = jQuery(window).width() > 768 ? 768 : jQuery(window).width(); //jQuery('.container').css('width',''); //jQuery(".container").width(w_w); //jQuery(".container").css('max-width',w_w+'px'); //jQuery(".container, #top-nav > div > ul,#top-nav > div > div > ul").width(w_w); //jQuery("#blog,.blog,#top-posts .container,#header-top + .container").width(w_w); if(window_cur_size == 'phone'){ jQuery("#header").find("#menu-button-block").remove(); jQuery("#top-nav").removeClass("open"); jQuery("#top-nav").css({"display":"block"}); jQuery("#header-top .container").append(jQuery("#social")); jQuery("#header-middle").prepend(jQuery("#logo")); jQuery("aside .sidebar-container .widget-area").removeClass("clear"); jQuery(".top-posts-block").width("100%"); jQuery('.added_not_exsisted_footer_sidbar').remove(); } if(window_cur_size == 'screen'){ jQuery("#top-nav > div > ul li:has(> ul),#top-nav > div > div > ul li:has(> ul)").each(function(){ var strtext=jQuery(this).children("a").html(); var strhref=jQuery(this).children("a").attr("href"); var strlink=''+strtext+''; jQuery(this).children("ul").prepend('