jQuery(window).load(function(){tacg_responsive_images();tacg_responsive_video();}); function tacg_responsive_images(){ jQuery('#pageorpost-content img').each(function(index){tacg_responsive_object(this);}); jQuery('.archive-content img').each(function(index){tacg_responsive_object(this);}); jQuery('.archive-posts img').each(function(index){tacg_responsive_object(this);}); jQuery('.mod-image img').each(function(index){tacg_responsive_object(this);}); jQuery('.mod-text img').each(function(index){tacg_responsive_object(this);}); } function tacg_responsive_video(){ jQuery('.content-innerwrap iframe').each(function(index){ tacg_responsive_object(this,'video'); }); } function tacg_responsive_object(obj,how){ var wid = jQuery(obj).attr('width'); var hit = jQuery(obj).attr('height'); if(wid!=undefined || hit!=undefined){ jQuery(obj).removeAttr('width'); jQuery(obj).removeAttr('height'); jQuery(obj).attr('data-wid',wid); jQuery(obj).attr('data-hit',hit); } if(wid==undefined || hit==undefined){ wid = jQuery(obj).attr('data-wid'); hit = jQuery(obj).attr('data-hit'); if(wid==undefined || hit==undefined){ wid = jQuery(obj).width(); hit = jQuery(obj).height(); jQuery(obj).attr('data-wid',wid); jQuery(obj).attr('data-hit',hit); } } jQuery(obj).css('max-width','100%'); jQuery(obj).css('width',wid+'px'); if(how=='video'){ jQuery(obj).css('height',hit+'px'); var width = jQuery(obj).width(); var height = width*(hit/wid); jQuery(obj).css('height',height+'px'); }else{ jQuery(obj).css('height','auto'); } } function tacg_navmenu_ops(how){ //alert(how); if(how=='open'){ jQuery('#mobile-navmenu-bg').show(); jQuery('#mobile-navmenu').addClass('open'); }else{ jQuery('#mobile-navmenu-bg').hide(); jQuery('#mobile-navmenu').removeClass('open'); } }