When using the ccResizeImage
binding, you can specify override dimensions for specific viewports. You can also specify a default size for any viewport for which no override dimension is provided. For example, in the following code snippet, the ccResizeImage
binding returns an image of size 80x80 and 120x120 for xsmall
and medium
viewports, respectively. For all other viewports, it returns an image of size 50x50.
<img data-bind="ccResizeImage: { source: '/file/v2/products/AntiqueWoodChair_full.jpg', xsmall: '80,80', medium: '120,120', size:'50,50', alt: 'Antique Wood Chair', errorSrc:'images/noImage.png', errorAlt:'No Image Found'}"></img>