$(document).ready(function(){ var width_content = $('#content_detail').width(); var src, width, height; $('figure').each(function(){ width = $(this).find('img').attr('width'); height = $(this).find('img').attr('height'); if(isNaN(width) || width==undefined || width==0 || isNaN(height) || height==undefined) {} else { var max_height = parseInt(width_content*height/width); width = Math.min(width, width_content); height = Math.min(height, max_height); src = $(this).find('img').attr('data-src'); if(src==undefined) src = $(this).find('img').attr('src'); https://src = src.replace("/files/", "/resize/"+width+"x"+height+"/files/"); https://$(this).find('img').attr('src', src).attr('width',width).attr('height',height); $(this).find('figcaption').width(width - 5); } var caption = $(this).find('figcaption h2').html(); if(caption==' ' || caption==' ') $(this).find('figcaption').remove(); }); $('.exp_tinyslide').each(function(){ var count_item = $(this).find('figure').size(); var html = ''; if(count_item==1) { $(this).find('img').each(function(){ html += '
'+$(this).attr('alt')+'

'+$(this).attr('alt')+'

'; }); } else if(count_item==2) { html = '
'; $(this).find('img').each(function(){ html += ''+$(this).attr('alt')+''; }); html += '
'; } else { html = '
'; $(this).find('.exp_wrap').children().each(function(){ if($(this).hasClass('exp_video')) html += '
'; else html += '
'+$(this).html()+'
'; }); html += '
'; } $(this).html(html).show(); }); setTimeout(function(){ $('.exp_slide_two').twentytwenty(); }, 500); if($('.explus_slider').length>0) $('head').append('