Vorlage:BildGrossZoom
Aus BogenWiki
(Unterschied zwischen Versionen)
Nugman (Diskussion | Beiträge) |
Nugman (Diskussion | Beiträge) |
||
Zeile 98: | Zeile 98: | ||
e = e || window.event; | e = e || window.event; | ||
// Get the x and y positions of the image: | // Get the x and y positions of the image: | ||
- | var | + | var RectZoom = eBogenZoom.getBoundingClientRect(); |
// Calculate the cursor's x and y coordinates, relative to the image: | // Calculate the cursor's x and y coordinates, relative to the image: | ||
- | var x = e.pageX - | + | var x = e.pageX - RectZoom.left; |
- | var y = e.pageY - | + | var y = e.pageY - RectZoom.top; |
// Consider any page scrolling: | // Consider any page scrolling: | ||
x = x - window.pageXOffset; | x = x - window.pageXOffset; | ||
Zeile 112: | Zeile 112: | ||
var BildZoomX = (x < 0 ? 0 : (x > BogenBildWz ? BogenBildWz : x)); | var BildZoomX = (x < 0 ? 0 : (x > BogenBildWz ? BogenBildWz : x)); | ||
var BildZoomY = (y < 0 ? 0 : (y > BogenBildHz ? BogenBildHz : y)); | var BildZoomY = (y < 0 ? 0 : (y > BogenBildHz ? BogenBildHz : y)); | ||
+ | // Auschnitt des Originalbildes (Zoom) verschieben | ||
+ | eBogenZoom.style.backgroundPosition = '-'+BildZoomX+'px -'+BildZoomY+'px'; | ||
// Overlay im Thumbnail verschieben | // Overlay im Thumbnail verschieben | ||
- | eBogenSmallOverlay.style.top = ''+( | + | var RectSmall = eBogenZoom.getBoundingClientRect(); |
- | eBogenSmallOverlay.style.left = ''+( | + | eBogenSmallOverlay.style.top = ''+(RectSmall.top+BildZoomY/10+window.pageYOffset)+'px'; |
+ | eBogenSmallOverlay.style.left = ''+(RectSmall.left+BildZoomX/10+window.pageXOffset)+'px'; | ||
eBogenSmallOverlay.style.height = ''+(eBogenZoom.clientHeight/10)+'px'; | eBogenSmallOverlay.style.height = ''+(eBogenZoom.clientHeight/10)+'px'; | ||
eBogenSmallOverlay.style.width = ''+(eBogenZoom.clientWidth/10)+'px'; | eBogenSmallOverlay.style.width = ''+(eBogenZoom.clientWidth/10)+'px'; |
Version vom 21:48, 12. Jul. 2018
[[{{{Gebiet}}} MiNr. {{{SatzMiNr}}}#Bogen_{{{Bild}}}|Zurück]] | ||
| ||
Small.X/Y = ... | Zoom.X/Y = ... | Zoom.ClientWidth/Height = ... | bFollowMouseSmall = ..., bFollowMouseZoom = ... | ||
[[{{{Gebiet}}} MiNr. {{{SatzMiNr}}}#Bogen_{{{Bild}}}|Zurück]] |