Vorlage:BildGrossZoom
Aus BogenWiki
(Unterschied zwischen Versionen)
Nugman (Diskussion | Beiträge) |
Nugman (Diskussion | Beiträge) |
||
| Zeile 46: | Zeile 46: | ||
document.getElementById('ClientWidth').innerHTML = eBogenZoom.clientWidth; | document.getElementById('ClientWidth').innerHTML = eBogenZoom.clientWidth; | ||
document.getElementById('ClientHeight').innerHTML = eBogenZoom.clientHeight; | document.getElementById('ClientHeight').innerHTML = eBogenZoom.clientHeight; | ||
| - | var BogenBildHz = eBogenZoom.clientHeight; | + | if (bFollowMouseMove) { |
| - | + | var BogenBildHz = eBogenZoom.clientHeight; | |
| - | + | var BogenBildWz = eBogenZoom.clientWidth; | |
| - | + | var BildX = (x*10-BogenBildWz/2 < 0 ? 0 : (x*10+BogenBildWz/2 > BogenBildW ? BogenBildW-BogenBildWz : x*10-BogenBildWz/2)); | |
| - | + | var BildY = (y*10-BogenBildHz/2 < 0 ? 0 : (y*10+BogenBildHz/2 > BogenBildH ? BogenBildH-BogenBildHz : y*10-BogenBildHz/2)); | |
| + | eBogenZoom.style.backgroundPosition = '-'+BildX+'px -'+BildY+'px'; | ||
| + | } | ||
} | } | ||
function MouseDown(e) { | function MouseDown(e) { | ||
bFollowMouseMove = !bFollowMouseMove; | bFollowMouseMove = !bFollowMouseMove; | ||
| - | document.getElementById('bFollowMouseMove').innerHTML = (bFollowMouseMove ? 'true' : 'false'; | + | document.getElementById('bFollowMouseMove').innerHTML = (bFollowMouseMove ? 'true' : 'false'); |
} | } | ||
</script></html> | </script></html> | ||
Version vom 06:54, 11. Jul. 2018
| [[{{{Gebiet}}} MiNr. {{{SatzMiNr}}}#Bogen_{{{Bild}}}|Zurück]] | ||
|
| ||
| X = ..., y = ... | ClientWidth = ..., ClientHeight = ..., bFollowMouseMove = ... | ||
| [[{{{Gebiet}}} MiNr. {{{SatzMiNr}}}#Bogen_{{{Bild}}}|Zurück]] | ||
