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

Disable or hide prev/next buttons when at begining or end #7

Closed
Flo-JB opened this issue May 4, 2022 · 3 comments · Fixed by #9
Closed

Disable or hide prev/next buttons when at begining or end #7

Flo-JB opened this issue May 4, 2022 · 3 comments · Fixed by #9

Comments

@Flo-JB
Copy link

Flo-JB commented May 4, 2022

It would be a great addition if the script could just add additional classes to the prev/next buttons if the start/end positions are reached to hide or disable them via css if needed (In non continuous mode).

With the actual implementation the user can click the buttons and nothing happens. With only one slide in the collection the buttons are completly useless right now.

I can help with that and create a pull request with this changes but maybe keep this open for discussion first - additionally I'm not sure what plans you have for swipe.js in Contao 5...

@0xhtml
Copy link

0xhtml commented Jun 20, 2023

Using the experimental :has() pseudo-class (https://developer.mozilla.org/en-US/docs/Web/CSS/:has), this CSS accomplishes hiding the prev und next link in Chrome but doesn't work in Firefox right now.

.slider-prev:has(+ .slider-menu > .active:first-child) {
    display: none;
}
.slider-menu:has(> .active:last-child) + .slider-next {
    display: none;
}

Though the implementation in CSS is a bit janky. Therefore, I would second that there should be a class added to the elements.

@leofeyer
Copy link
Member

I can help with that and create a pull request with this changes

I would appreciate that very much. 👍

@Flo-JB
Copy link
Author

Flo-JB commented Sep 21, 2023

See #9

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

Successfully merging a pull request may close this issue.

3 participants