9.9 KiB
9.9 KiB
1.1.0 (2023-11-16)
Features
1.0.8 (2022-11-15)
Bug Fixes
1.0.7 (2022-11-14)
Bug Fixes
- ensure zooming out doesn't happen (#176) (b920940)
- remove
loadingattribute on HD target (#186) (dd01423)
1.0.6 (2020-07-08)
Bug Fixes
1.0.5 (2019-12-07)
Fixed
1.0.4 (2019-04-06)
Fixed
1.0.3 (2019-01-20)
Changed
Fixed
1.0.2 (2018-09-05)
Added
- Improve TypeScript definition (#73)
1.0.1 (2018-08-29)
Fixed
1.0.0 (2018-08-28)
Added
- Methods become chainable. All methods except getters and animation methods (
open(),close()andtoggle()) return the zoom object to allow method calls to be chained.
const zoom = mediumZoom()
zoom
.attach('#image-1', '#image-2')
.on('open', () => zoom.update({ background: 'yellow' }))
.open()
- Animation methods return promises.
open(),close()andtoggle()return promises resolving with the zoom for acting accordingly when the animation is completed. To remain compatible with IE10, promises are converted to no-operation functions if unavailable.
const zoom = mediumZoom('[data-zoom]')
zoom.open().then(() => zoom.update({ background: 'yellow' }))
-
Options
backgroundsupports thebackgroundCSS property (not onlybackground-color)
-
Methods
attach(...selectors: string[]|Element[]|NodeList[]|Array[]) => Zoomclone(options?: object) => ZoomgetOptions() => objectgetImages() => Element[]getZoomedImage() => Element
-
Events
- "update" is fired when the
updatemethod is called
- "update" is fired when the
-
Add TypeScript definitions
-
Improve documentation
Fixed
- HD image scales the first time on Firefox (264c81f9d54b7272fa260616f117c3149be89123)
- Support
srcsetattribute (#51) - Support SVG sources (#56)
Breaking changes
- Imports. If you're using CommonJS, you'll need to change the require statement:
- const mediumZoom = require('medium-zoom')
+ const mediumZoom = require('medium-zoom').default
-
No images selected by default. Prior to version 1, all scaled images (via HTML or CSS properties) were added to the zoom when calling
mediumZoom(). Now, callingmediumZoom()without selector does not attach any images to the zoom. This change is necessary for having a more predictable behavior and a more composable API. -
Options
metaClickwas removed
-
Methods
show() => void→open({ target?: Element }) => Promise<Zoom>hide() => void→close() => Promise<Zoom>toggle() => void→toggle({ target?: Element }) => Promise<Zoom>detach() => void→detach(...selectors: string[]|Element[]|NodeList[]|Array[]) => Zoomupdate(options: object) => void→update(options: object) => ZoomaddEventListeners(type: string, listener: Function) => void→on(type: string, listener: Function, options?: object) => ZoomremoveEventListeners(type: string, listener: Function) => void→off(type: string, listener: Function, options?: object) => Zoom
-
Attributes
data-zoom-target→data-zoom-src
-
Events
- "show" → "open"
- "shown" → "opened"
- "hide" → "close"
- "hidden" → "closed"
0.4.0 (2018-03-09)
Added
Fixed
- Calling
.detach()when having a zoomed image: 9fa798d3fe96ae7060f316995b84eaacf3ce8a11
0.3.0 (2017-12-07)
Added
- Add support for
templates andcontainers: d0d1ec141ffe744d059dddcfc08b6e830b7c17c9
0.2.0 (2017-10-01)
Added
- Add HD support: 1db9607dce2aa348d9be465208395d125b16e728
Changed
- Rewrite core implementation: 5158cace958acee0e89a4c9358704ed504756254
- Update library description: a6f424bae2da534563154c26b49046367d7db215
- Use less restrictive CSS rules: acaeba4bf96576b65867c3effc2710bd9d029dc0
- Reduce latency on click to unzoom: 3c4c2fef2c2fca2ce542e57e13ce3198fe7ba2bb
Fixed
- Fix
hideevent being thrown multiple times on scroll: 3c4c2fef2c2fca2ce542e57e13ce3198fe7ba2bb
0.1.8 (2017-09-17)
Fixed
- Do not trigger the zoom when target is
null(can happen on fast double click): 3f795b44877af341ed65ae7c1bc764cc5122cdfb
0.1.7 (2017-07-21)
Fixed
- Don't ignore margin on floating images: 384f0b1576e66f16844e0482eb1653a0c9479ad2
0.1.6 (2017-07-19)
Fixed
- Support
scrollTopposition on Firefox: ee13718c38a7a4ba486cacfb50f2861dd1adb8ad
0.1.5 (2017-06-10)
Changed
- Wrong selector trows a
TypeErrorinstead of aSyntaxError: 38e6292ce83d1b54f4fd80cce03d737c3872a58f - Library now fully exported by webpack: 5c7944b5e2de19828c8f9298fdc7a03a9146e42b
- Production version is used when importing the library: 3a7d8ebc0ddd2cb142ccb8519de6fc57e8e8ba3e
0.1.4 (2017-05-31)
Added
- Support NodeLists, HTMLCollections and Nodes (#8): aa8ff0ff6743e0bc011ea162ff068a2ddbb0f9ab
Changed
- Apply the default selector only when the plugin is given none (#7): aa8ff0ff6743e0bc011ea162ff068a2ddbb0f9ab
0.1.3 (2017-04-01)
Fixed
- Center image when the doctype is not declared (#4): 95be45a63837bcd282433728f8db8759bd5777cb
- Ignore zero-pixel scroll offset: 3cd34640ab26b04b802ce39ce74f092180e3cb00
0.1.2 (2017-03-04)
Added
.detach()method that unsubscribe images from the zoom (#2): 2ceb5120ebc35bb457a08474e0d39430e253ab08
0.1.1 (2016-10-06)
Fixed
- Export the plugin for npm usage (#1): affca211ac6999f1d2c554205d5b216c37fc7c1c
0.1.0 (2016-07-28)
Initial release.