');var hanlerWidth=el.querySelector('.t410__wrapper .jx-handle').offsetWidth,leftSide=el.querySelector('.t410__wrapper .jx-image.jx-left'),rightSide=el.querySelector('.t410__wrapper .jx-image.jx-right'),leftWidth=leftSide.offsetWidth - hanlerWidth/2,rightWidth=rightSide.offsetWidth - hanlerWidth/2,wrapper=el.querySelector('.t410__wrapper'),mobileLeft=el.querySelector('.t410__mobile_left'),mobileRight=el.querySelector('.t410__mobile_right');mobileLeft.style.width=leftWidth + 'px';mobileRight.style.width=rightWidth + 'px';wrapper.addEventListener('touchend',function() {leftWidth=leftSide.offsetWidth - hanlerWidth/2;rightWidth=rightSide.offsetWidth - hanlerWidth/2;mobileLeft.style.width=leftWidth + 'px';mobileRight.style.width=rightWidth + 'px';});}}});let inter=setInterval(function(){let sld=document.querySelectorAll('#' + blk + ' [data-elem-id="' + id + '"] .jx-right img');if(sld.length>0) {clearInterval(inter);var left=document.querySelector('#' + blk + ' [data-elem-id="' + id + '"] .t410__wrapper').getAttribute("data-juxtapose-imgurl-first");var right=document.querySelector('#' + blk + ' [data-elem-id="' + id + '"] .t410__wrapper').getAttribute("data-juxtapose-imgurl-second");let style=window.getComputedStyle(document.querySelector('#' + blk + ' [data-elem-id="' + id + '"]'));var width=style.width.replace("px","");document.querySelector('#' + blk + ' [data-elem-id="' + id + '"] .jx-image.jx-left').insertAdjacentHTML('afterbegin','
');document.querySelector('#' + blk + ' [data-elem-id="' + id + '"] .jx-image.jx-right').insertAdjacentHTML('afterbegin','
');let img=document.querySelectorAll('#' + blk + ' [data-elem-id="' + id + '"] img');img.forEach(function(item) {item.remove();});}},50);});let dispchng=el.querySelector('.t410');dispchng.addEventListener('displayChanged',function(){window.juxtapose.sliders.forEach(function(obj) {if(obj.selector==='#t410-juxtapose__' + recid) {obj.setWrapperDimensions();return}});})};function t_ready(t) {"loading"!=document.readyState?t():document.addEventListener?document.addEventListener("DOMContentLoaded",t):document.attachEvent("onreadystatechange",function() {"loading"!=document.readyState&&t()})} t_ready(function() {let opt=setInterval(function(){let slds=document.querySelectorAll('[nlm076-slider-id="691965"] [data-juxtapose-imgurl-first="https://static.tildacdn.com/tild3737-3833-4736-a563-373138313362/1.jpg"][data-juxtapose-imgurl-second="https://static.tildacdn.com/tild3261-3962-4763-b262-346330653732/2.jpg"]');if(slds.length>0) {clearInterval(opt);t410_onObjLoad('juxtapose',function() {slds.forEach(function(item,index) {let parent=item.closest('.nolimnlm76');if(parent) {parent.classList.remove('nolimnlm76');let id=item.closest('[data-elem-id]').getAttribute('data-elem-id');let blk=item.closest('.r').getAttribute('id');t410_init(id,blk);window.addEventListener("resize",function() {let sldWidth=item.closest('.tn-elem').style.width;let int=setInterval(function() {let sldWidth2=item.closest('.tn-elem').style.width;if(sldWidth!=sldWidth2) {clearInterval(int);document.querySelector('#' + blk + ' [data-elem-id="' + id + '"] .jx-image.jx-right').firstChild.style.width=sldWidth2;document.querySelector('#' + blk + ' [data-elem-id="' + id + '"] .jx-image.jx-left').firstChild.style.width=sldWidth2;}},10);setTimeout(function() {clearInterval(int);},2000);});}});});}},50);});function t410_onObjLoad(objName,okFunc,time) {if(typeof window[objName]==='object') {okFunc()} else {let timerId=setTimeout(function checkFuncExist() {if(typeof window[objName]==='object') {okFunc();return} timerId=setTimeout(checkFuncExist,time||100)});};};}());
Комментарии к статье
Комментарии: 0