// reset all containers function resetContainers(target) { $('.' + target).find('.icon').removeClass('icon-minus-icon').addClass('icon-plus-icon'); $('.' + target + '__section__hidden').css({ 'display': 'none' }); $('.' + target + '__section__top, .' + target + '__section__title').removeClass(target + '__section__active'); } //loads the individual resource sections function loadSection($this, target) { var $firstTarget = $this.find('.' + target + '__section:first'); //$firstTarget.css({'max-height':'5000px'}); //$firstTarget.find('.'+target+'__section__top, .'+target+'__section__title').addClass(target+'__section__active'); //$firstTarget.find('.icon').removeClass('icon-plus-icon').addClass('icon-minus-icon') //$firstTarget.find('.'+target+'__section__hidden').css({'display':'initial'}); var $firstSection = $firstTarget.find('.' + target + '__section__top'); // loadResources($firstSection,target); } // loads the images by getting the data attribute and appending the div, it will play animation once then remvove it on the second time. function loadResources($this, target) { $this.siblings().find('.' + target + '__item .' + target + '__item__image').each(function () { var $image = $(this).attr('data-img'); var $alt = $(this).attr('data-alt'); if (!$(this).find('img').length) { $(this).append('' + $alt + '') .waitForImages(function () { $(this).find('.loader').remove(); }); } else { $(this).find('img').removeClass('' + target + '__item__animation'); } }); }