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

Looks like it's not working if width isn't specified #21

Closed
siamkreative opened this issue May 22, 2015 · 3 comments
Closed

Looks like it's not working if width isn't specified #21

siamkreative opened this issue May 22, 2015 · 3 comments

Comments

@siamkreative
Copy link

When I copied the markup + Prerequisted CSS styles from the demo page, slider didn't work. It seems to be because in the demo you actually specify a fixed width for the li element.

.simple li {
    width: 270px;
    margin-right: 10px;
}
@media screen and (min-width: 640px ) {
    .simple li {
        width: 580px;
    }
}
@media screen and (min-width: 980px ) {
    .simple li {
        width: 880px;
    }
}

So my question is... is there a way to make it work out of the box, without specifying a width? I feel like it's a bit annoying to specify a fixed width in a responsive context.

@meandmax
Copy link
Collaborator

Hey @siamkreative,

this feature is currently not supported, because I didn`t want to handle styling in my JavaScript.

But if you want to set a own width of the slides dependent on the browser width you can always listen to the resize event and call lory.reset() afterwards which would re-initialize lory with the current widths of the slide elements.

Maybe this is a little Add-on. I really try to keep lory as lightweight as possible! The way to go would be to use the callbacks in the options and the public-api. If you need something that you can actually implement this, just tell me.

cheers Max

@siamkreative
Copy link
Author

I'm not sure you understood me correctly. I meant that Lory didn't work with PREREQUISITED HTML & PREREQUISTED CSS STYLES:

image

I had to manually specify a width in pixels for the <li> elements. This is what you're doing in your stylesheet [app.css)(http://meandmax.github.io/lory/demo/app.css) line 199. If the width is required for the script to work, then perhaps it would be a good idea to mention it in the documentation :)

@meandmax
Copy link
Collaborator

Yes I understood you. I didnt add a width to the demo css because its always different. But you are right that I need to mention that you have to specify a width for the "li" element.

Thanks for the advice!

cheers Max

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