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

Add option to account for a full viewport width carousel #5

Open
wking-io opened this issue Aug 29, 2017 · 3 comments
Open

Add option to account for a full viewport width carousel #5

wking-io opened this issue Aug 29, 2017 · 3 comments
Assignees

Comments

@wking-io
Copy link

I have a use case where this is full screen and since it only calculates the element.offsetWidth it is off by the size of the scrollbar in browsers.

@zoltantothcom
Copy link
Owner

As of now the carousel isn't responsive, so the images not scaling to the viewport width, i.e. max-width: 100% won't work. Did you mean by "full screen" just a fairly large image (wider than the screen) that's being cut off? If not - can you please paste the CSS you're using? Thanks!

@wking-io
Copy link
Author

wking-io commented Aug 30, 2017

So the CSS I have used is:

width: 100vw;

And then to get it to work in the js when it calculates the image width I added the following:

var carousel = new Carousel({
	elem: 'blog-slider',    // id of the carousel container
	fullWidth: true     // show slider full screen
});

// Added this to the plugin options setup
slideWidth = options.fullWidth ? window.innerWidth : element.offsetWidth;
// Then replaced the three instances in the code

@zoliky
Copy link

zoliky commented Feb 28, 2019

Hello, Zoltán. Kiprobáltam és nagyon strammul müködik. Kár, hogy nem adaptálodik az ablak mérethez.

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

No branches or pull requests

3 participants