(function(){ $('.flex-container').waitForImages(function() { $('.spinner').fadeOut(); }, $.noop, true); $(".flex-slide").each(function(){ $(this).hover(function(){ $(this).find('.flex-title').toggleClass('active'); $(this).find('.flex-title').removeClass('active2'); $(this).find('.flex-title').css({ transform: 'rotate(0deg)', top: '50%', color: '#fff', opacity: '1', transform:'translate(0,-50%)', }); $(this).find('.flex-about').css({ opacity: '0', top: '30%' }); $(this).find('.flex-slide').css({ background: 'none' }); }, function(){ $(this).find('.flex-title').toggleClass('active2'); $(this).find('.flex-title').removeClass('active'); $(this).find('.flex-title').css({ transform: 'rotate(0deg)', top: '65%', color: '#fff', opacity: '0' }); $(this).find('.flex-about').css({ opacity: '1', top: '50%' }); }) }); })();