added documentation and img-magnifier
This commit is contained in:
17
src/app/img-magnifier/img-magnifier.component.html
Normal file
17
src/app/img-magnifier/img-magnifier.component.html
Normal file
@ -0,0 +1,17 @@
|
||||
<div class="img-container">
|
||||
<div class="magnifier"
|
||||
[ngStyle]="{
|
||||
'background-size': backgroundSize,
|
||||
'background-image': 'url(\'' + src + '\')',
|
||||
'background-position': '-' + magnifierPos.x * zoom + 'px -' + magnifierPos.y * zoom + 'px',
|
||||
left: magnifierPos.x + 'px',
|
||||
top: magnifierPos.y + 'px',
|
||||
width: magnifierSize.width + 'px',
|
||||
height: magnifierSize.height + 'px'
|
||||
}"
|
||||
(mousemove)="calcPos($event)"
|
||||
(mouseleave)="showMagnifier = false"
|
||||
*ngIf="showMagnifier">
|
||||
</div>
|
||||
<img [src]="src" alt="" (mousemove)="calcPos($event)" (mouseenter)="showMagnifier = true" #mainImg>
|
||||
</div>
|
Reference in New Issue
Block a user