$(document).ready(function(){ $(".picCaption").hide(); }) $(window).load(function(){ var picTrans= ''; $(".picCaption").append(picTrans); if($(".picCaption").length>0){ $(".picCaption").show(function(){ $(this).find('span').css({'height':'auto'}); $(this).find('span:first').css({'width':'auto'}); if(!$(this).find(".semiTrans")) $(this).append(''); $(this).append(''); var img=$(this).siblings('img')[0]; var thisH=$(this).height(); //console.debug(thisH); $(img).wrap('
'); var parentDiv=$(this).parent().find('.easyCaptionDiv'); //console.debug(parentDiv); //parentDiv.prepend($(this)).after('
'); parentDiv.prepend($(this)).after('
'); $(this).css({'bottom':0,'position':'absolute','margin':0, 'left':0,'z-index':1,'display':'block','width':'100%'}); var hght=$(this).find('span:first').outerHeight(); $(this).find(".semiTrans").height(hght); $(this).height(hght); }); $(".picCaption").show(); } })