1.2.1 • Published 7 years ago

angular2-image-zoom v1.2.1

Weekly downloads
667
License
MIT
Repository
github
Last release
7 years ago

angular2-image-zoom

Angular 2.x.x Compatible

Installation

To install this library, run:

$ npm install angular2-image-zoom --save

Examples

First, import the ImageZoom Module

import {ImageZoomModule} from 'angular2-image-zoom';

Then, add ImageZoom to your modules import array

@NgModule({
    imports : [CommonModule, ImageZoomModule, ...],
})

Then just add the imageZoom tag to your img element

<img [imageZoom]="zoomedImageSrc" [src]="smallImageSrc" [style.width.px]="width" [style.height.px]="height">

Options

NameTypeDefaultDescription
imageZoomstringnullLink to larger src image
allowZoombooleantrueWhether or not zooming is enabled
clickToZoombooleanfalseForce a user to click before zooming begins, click again to stop zooming
scrollZoombooleantrueAllow mousewheel to change zoom level
windowPositionnumber1Position of zoom window. (1-16)
lensStylestring'WINDOW'Type of zoom ('LENS', 'WINDOW')
lensWidthnumber300Width of zoom lens
lensHeightnumber300Height of zoom lens
lensBordernumber2Size of lens border (in pixels)
delaynumber100Delay before zoom lens appears (in milliseconds)
minZoomLevelnumber.2TODO
maxZoomLevelnumberauto-calculatedTODO
zoomLevelIncrementnumber.1Size of each change in zoom level while scrolling

This library is a work in progress and any issues/pull-requests are welcomed!

TODO

  1. Create unit and E2E tests
  2. Allow window to be placed anywhere
  3. Show viewing lens over image to show zoom area
  4. Allow mouse scrolling to change zoom level
  5. Allow inner zoom lens
  6. Lots more....

Development

To generate all * }.js, *.js.map and *.d.ts files:

$ npm run tsc

License

MIT © Nick Richardson

1.2.1

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.5.1

8 years ago

0.5.0

8 years ago

0.4.2

8 years ago

0.4.1

8 years ago

0.4.0

8 years ago

0.3.2

8 years ago

0.3.1

8 years ago

0.3.0

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago