Pure CSS collapsible tree menu
thecssninja.com
thecssninja.com
Better to keep the example on its own independent page.
But that does make CSS cleverness seem unappealing given that even the "showcases" are broken.
jquery_menu (line 1): ("li").addClass("selected").parent().p...).addClass("selected"); }); });
My FF is in Windows at the moment; it would be weird if that was the real difference.
I wonder if it has to do with the use of C++-style comments on unbroken lines? The HTML is pretty fairly unreadable on my side, as if someone joined most of the lines together, both in linux (I did a wget on your link) and Windows. As a result, I think some of those braces are on the same line as a // comment.
It's 1.5kb of CSS that doesn't require any javascript.
I understand that people want something they can put together quickly, so they find a script that does it and they figure out how to integrate it... but I've learned that it actually takes more time to do all that than write my own little script that does exactly what I'm looking for with less code... and it's optimized for the particular code it works with (for which it works for you grammar-whores ;)).
Not to mention, I've learned way more by doing it myself and in the long run I progress faster... all while writing more efficient code.
And for this very same reason, I don't use jQuery or any other libraries... the majority of them are way too bloated for what I need (most of the time). Exceptions include server-side libraries for graphing, reading/writing from/to excel, etc.
If you're using other server-side languages I'm sure a search engine query or two will return decent results... don't go straight for the first one though. Check a few out and see what suits you best.
I will say though that PHPExcel has never failed me.
And I just noticed the version I'm using is out of date too... thanks! Gonna [try to] get it up to date now. :)
While this is a clever trick, it pollutes your CSS with application logic that should be separated from your design.
- HTML for content and markup
- CSS for design and style
- JavaScript for client application logic
additionally, styling by attribute is hardly a different than styling by class. it just so happens that this attribute is dynamic. the actual logic that's taking place here is not in the css; it is inherently handled by the browser.