<script>
$( document ).ready(function() {
//Прописываем ID наших блоков
var ZeroID = "#rec166100554"; //Zero
var AccoRD = "#rec166100555"; // TX16N
//Добавляем класс к нашим картинкам
$('[href="#mainpic"]').addClass('mainpic');
//Переносим аккордеон в ZeroBlock
$(AccoRD).appendTo('.accordion');
var ZeroBack = ""+ZeroID+" .t396__artboard , "+ZeroID+" .t396__carrier , "+ZeroID+" .t396__filter";
//При раскрытии нужного аккордеона - изменяем высоту ZeroBlock и положение картинок
$( AccoRD+" .t585__header" ).click(function() {
var thelem=this;
cohnheight = $(this).siblings('.t585__content').height();
setTimeout(function(){
if($(thelem).hasClass('t585__opened')){
cohnheight = $(thelem).siblings('.t585__content').height();
$(ZeroBack).animate({height:'+='+cohnheight},600);
$(".mainpic").parent(".tn-elem").animate({top:'+='+cohnheight},600);
}else{
$(ZeroBack).animate({height:'-='+cohnheight},600);
$(".mainpic").parent(".tn-elem").animate({top:'-='+cohnheight},600);
};
}, 400);
});
$( window ).resize(function() {
$(AccoRD+' .t585__header').removeClass('t585__opened');
$(AccoRD+' .t585__content').hide();$(ZeroBack).css('height','');
});
});
</script>