imgSlider icon indicating copy to clipboard operation
imgSlider copied to clipboard

need to control max-width

Open joyously opened this issue 9 years ago • 2 comments

Since this script manipulates the width of a div containing an image, the CSS needs to control the max-width. It is very common to use max-width:100% on images so that they scale, but that ruins the effect of this script. So the CSS should have .slider img {max-width:none} to make sure it works correctly, regardless of the user's CSS.

joyously avatar Jan 22 '16 17:01 joyously

@joyously I am not quite sure I follow. Please go ahead and submit a pull request.

kavyasukumar avatar Jan 25 '16 21:01 kavyasukumar

I've tried two different approaches, and I don't know which works best. To test the plugin better, add some other common CSS to your demo, such as img {max-width:100%} /*to make it like a 'real' page */ Then you will see that your plugin does not handle this well, so it either needs to use .slider img {max-width:none} or the script needs to use $this.find('img').css('max-width', width + 'px'); //(but this might not work right, perhaps test 'none' here) because the user should be able to have the image max-width set for their other images without affecting the plugin.

joyously avatar Jan 25 '16 22:01 joyously