Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

need to control max-width #10

Open
joyously opened this issue Jan 22, 2016 · 2 comments
Open

need to control max-width #10

joyously opened this issue Jan 22, 2016 · 2 comments

Comments

@joyously
Copy link

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.

@kavyasukumar
Copy link
Owner

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

@joyously
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants