jQuery(function() { jQuery(".content-area .hoverShad").css("opacity","0"); // on mouse over jQuery(".content-area").hover(function () { // animate opacity to full jQuery(this).find(".imageCover").stop().animate({ opacity: 0 }, "slow"); }, // on mouse out function () { // animate opacity to nill jQuery(this).find(".imageCover").stop().animate({ opacity: 1 }, "slow"); jQuery(this).find(".infoCont").slideUp(); jQuery(this).find(".infoBlk .infoLink").removeClass('current') }); //slideToggle jQuery('.content-area .infoLink').click(function() { jQuery(this).toggleClass('current'); jQuery(this).parents('.content-area').find(".infoCont").slideToggle(); }); //count total images jQuery('.content-area').each(function() { jQuery(this).find('.slideInfo .totalImg').html(jQuery(this).find('.workImgCont img').length); }); //on image click jQuery('.imageCover').click(function() { var currentImgInSlides = jQuery(this).next('.workImgCont').find('img:visible').next().index()+1; if(currentImgInSlides==0) { jQuery(this).parents('.content-area').find('.slideInfo .currentImg').html(1) } else { jQuery(this).parents('.content-area').find('.slideInfo .currentImg').html(currentImgInSlides) } }); //init jquery cycle plugin for future work jQuery('.workImgCont').each(function() { jQuery(this).cycle({ fx:'scrollHorz', next: jQuery(this).parents('.content-area').find('.imageCover'), timeout: 0, speed:200, slideExpr: '.slide', slideResize: 0 }); }); //init jquery cycle plugin for blog post jQuery('.blog-imagecycle').each(function() { jQuery(this).cycle({ fx:'scrollHorz', next: jQuery(this).parents('.thumb').find('.imageCover'), timeout: 0, pager:'#nav-blog', slideExpr: '.slide', slideResize: 0 }); }); });