scaleflex / js-cloudimage-responsive

Cloudimage Responsive will smartly resize, compress and accelerate images across the World in your site for all devices. The plugin supports lazy loading technique with fancy animation on image load. Any questions or issues, please report to https://github.com/scaleflex/js-cloudimage-responsive/issues
Other
68 stars 15 forks source link

2 suggestions: W3C validation + prevent enlargement #14

Closed migliori closed 4 years ago

migliori commented 4 years ago

Hi,

I started to use the plugin and many features are really great, but I encounter 2 problems:

  1. I wonder why you set the plugin to use ci-src instead of data-src data-src is validated with W3C but ci-src is not. Is there a workaround? (it may be an idea to allow users to set their preference)

  2. I couldn't find a way to keep the images within their original dimensions. For example: I have a 750px wide image. I want it to be reduced on small screens, but I don't want it to be larger than 750px on large screens. By using the width and/or prevent_enlargement settings, the loaded image has the right dimensions, but the wrapper is 100% wide. I haven't found a solution except to load the image directly from the Cloudimage URL without using ci_src, which is not ideal. Is there a way?

Thank you for your answer

dzmitry-stramavus commented 4 years ago

hey @migliori ,

Implemented in v4.6.0

https://github.com/scaleflex/js-cloudimage-responsive#imgselector https://github.com/scaleflex/js-cloudimage-responsive#bgselector

dzmitry-stramavus commented 4 years ago

about 2

there is parameter in cloudimage servcie org_if_sml=1 https://docs.cloudimage.io/go/cloudimage-documentation-v7/en/image-resizing/prevent-enlargement

Shackless commented 4 years ago

Would it be possible to add a data-* variant for all your custom attributes on images like ci-sizes? Those still invalidate the HTML which could easily be avoided.

dzmitry-stramavus commented 4 years ago

hey @Shackless ,

Yes, to all params you can use data-* variant

Shackless commented 4 years ago

data-ci-sizes doesn't work while ci-sizes does.