3 ms·
Pure CSS3 accordion
In this article you’ll learn how to create a pretty simple animated accordion with CSS3 :target pseudo-class.
- AndyNemmity 15y agoThe back button flips back through the accordion, which is unexpected, and not very elegant.
- thomasgerbe 15y agoWas going to say this. I really detest sites that hijack the back button.
- redmaniack 15y agoIt's because the accordion is made with CSS only and it uses the :target pseudo-class. The back button is not "hijacked" :)
- pavel_lishin 15y agoYes, it is, because it's not doing what I expect it to do. It's neat, but it's still hijacking.
- ugh 15y agoWhy is it not doing what you expect it to do? When content on a page changes, an entry should be added to the history.
- pavel_lishin 15y agoI don't think that everyone is still used to it. Many pages have scrolling ticker-style feeds - hitting "back" doesn't rewind that.
- ugh 15y agoI would argue that entries to the history should be added when user interaction was involved and when a significant amount of the content has changed.
- pavel_lishin 15y agoThis is pretty awesome; anyone know how many mobile browsers support this? We've been relying on jQuery mobile, but it's a bitch and a half convincing it that we don't really want pretty rounded shade borders around the icons, or that we don't want them on the left-hand side.
- jacobr 15y agoIf the page content is taller than the browser viewport, you will, due to the nature of hash links, jump/scroll to the expanded entry. This may or may not be desired.
- r0s 15y agoThis guy: http://www.cssplay.co.uk/menus/ http://www.cssplay.co.uk/menus/ Has been at it for years, lots of good stuff there.