A CSS only slider (no JS) (significa.pt)
over 6 years ago from Rui Sereno, Partner @ Significa.co
over 6 years ago from Rui Sereno, Partner @ Significa.co
I've never understood people replacing Javascript by hacking form inputs. This is a pointless hack - this is not what form inputs were designed for. Also, if you add or remove a card, you need to tweak the CSS.
What's wrong with Javascript anyway? Javascript is a beautiful, performant language. This is just poor engineering.
Hello Colm, You're definitely correct. Nothing wrong with Javascript. The thing is there's a lot of people who struggle with JS and are quite comfortable with CSS. This hack is for them. Nonetheless, thanks for your comment.
Another point to add, using CSS like this is a great way to add interactivity for sites that have javascript disabled, i.e. .onion sites using the Tor Browser.
JavaScript disablers are literally no fun at parties.
Well yeah I get that it's to appease beginners, it's just that your solution is so needlessly complex and as Alex noted - much more complex than the relatively simple few lines of JS required.
Ultimately, it's just bad code and I don't like encouraging beginners down this path. I think it would be great if the article came with a very basic JS solution at the bottom, which might encourage beginners to give it a try.
This is cool and all, but it almost seems harder than just doing it in JavaScript.
Great tutorial and worth the read! ...but this is a no go for production environments. no touch events or accessibility. :(
Hey! I think this is excellent. While there are plenty of folks who would choose to implement this in JS, doing it in CSS at least shows a deep understanding of the language.
And, you're really doing good things by writing up your process. Keep it up.
Someone with a deep understanding of HTML and CSS would never choose to implement this in HTML and CSS.
Creative. I'll give you that.
Designer News
Where the design community meets.
Designer News is a large, global community of people working or interested in design and technology.
Have feedback?
Login to Comment
You'll need to log in before you can leave a comment.
LoginRegister Today
New accounts can leave comments immediately, and gain full permissions after one week.
Register now