Automatic Resize Demo
Demonstrates automatic resize feature of ImageMapster introduced in
v1.5.0. To enable automatic resize, you must set two configuration values:
-
enableAutoResizeSupport (true|false) - Set this to true to enable the
feature. If you want to enable/disable this feature after initializing
mapster, you must use `rebind`.
-
autoResize (true|false) - When auto resize support is enabled and
autoResize === true, ImageMapster will automatically resize the image to
the size of its container. This option can be toggled via set_options
API.
Additional Auto Resize Configuration Options:
-
autoResizeDelay (int) - The amount of time to delay resizing when window
resize event occurs. Default is 0 (zero).
-
autoResizeDuration (int) - Corresponds to `resize` API duration
parameter. Default is 0 (zero).
-
onAutoResize (func) - Correponds to `resize` API callback parameter.
Default is null.
Change the size of the window to see how the image automatically resizes
to its container size.