diff options
| author | Daniel Schmitzer <noreply@maennchen1.de> | 2023-01-16 09:23:42 +0000 |
|---|---|---|
| committer | Daniel Schmitzer <noreply@maennchen1.de> | 2023-01-16 09:23:42 +0000 |
| commit | e639d95ce2e8a57beda5777beea9cd899fd2c311 (patch) | |
| tree | 29d448425ef3d743498c7e96225a8531a07e098a /views/js | |
| parent | 926f2c438e67f88356bed829462d7555acb9ce3c (diff) | |
Feature: standard3.phtml (Slider und Zoom)
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@8196 0d5edaf7-2b12-4e95-93f4-047927463d4b
Diffstat (limited to 'views/js')
| -rw-r--r-- | views/js/dsimagezoom.min.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/views/js/dsimagezoom.min.js b/views/js/dsimagezoom.min.js new file mode 100644 index 0000000..7748583 --- /dev/null +++ b/views/js/dsimagezoom.min.js @@ -0,0 +1 @@ +class DsImageZoom{static destroy(t){void 0===t&&(t=document.getElementsByClassName("ds_image_zoom"));for(const e of t){const t=e.getElementsByTagName("img")[0];e.classList.remove("attached"),e.setAttribute("style",""),t.setAttribute("style","")}}static init(t){void 0===t&&(t=document.getElementsByClassName("ds_image_zoom"));for(const e of t){const t=e.getElementsByTagName("img")[0];t.onload=()=>{const s=t.getBoundingClientRect().width,i=t.getBoundingClientRect().height,a=.5*s;e.setAttribute("data-image-width",s),e.setAttribute("data-image-height",i),e.setAttribute("data-factor",a),e.style.width=s+"px",e.style.height=i+"px",t.style.width=s+"px",t.style.height=i+"px",e.classList.add("attached"),e.addEventListener("mousemove",(o=>{t.style.width=s+a+"px",t.style.height=i+a+"px";const n=(o.x-e.getBoundingClientRect().x)/s,d=(o.y-e.getBoundingClientRect().y)/s;t.style.left=-1*a*n+"px",t.style.top=-1*a*d+"px"})),e.addEventListener("mousein",(t=>{})),e.addEventListener("mouseout",(e=>{t.style.width=s+"px",t.style.height=i+"px",t.style.left="0px",t.style.top="0px"}))},t.setAttribute("src",t.getAttribute("data-src"))}}} |
