Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

An other example of "you don't need js" carousel :

https://www.codepel.com/demo/css-carousel-slider-without-jav...

there's an other comment posting a tailwind version , and I thought having a raw version would be helpful too

that's the issue with raw things, as you don't need any library, they are not marketed and it's really hard to find them when libraries take all the first results



This works terribly on mobile and broke my back navigation…


Can you precise what works terribly ? On which mobile browser ? I m interrested as I plan on replacing our current carousels by this one

for the "it broke the back button" isn't because it uses anchor so it works as expected for anchor , i.e you get to the previous anchor before going back ? (Which can be overrided by a line of javascript if you dont want that behaviour, but at least you can link to a specific slide of the caroussel )


It scrolls the screen to the carousel on click, and every click adds to page history so you need to click that many time to back out.

Just because you use an anchor tag, and anchor tags add to page history, doesn't automatically make it "working as expected". It's unexpected behavior for the user.


Sorry I meant "its working as expected per the spec", which is not what the user expects I agree with you on that (I may differ that it depends on the context for example if the caroussel is the full page on mobile , in which the fact it scrolls to the carousel are unimportant , which is the use case i intend to use them on)

My point is its different from "it broke the back button" , when you use the table of content links in wikipedia they have the same behaviour and you don't go that it broke the back button


fyi, "another" is a single word


Thank you ! As you may have guessed English is not my first language.


My pleasure. Grammar nitpicking tends to get downvoted (as happened here), but my intent is to help educate. Glad it helped!




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: