Skip to content

Instantly share code, notes, and snippets.

@jonbca
jonbca / gist:862069
Created March 9, 2011 11:46
JQuery Details fallback
$(function() {
// Execute the fallback only if there’s no native `details` support
if (!('open' in document.createElement('details')) || ($.browser.webkit && $.browser.version >= 534.16)) {
// Loop through all `details` elements
$('details').each(function() {
// Store a reference to the current `details` element in a variable
var $details = $(this),
// Store a reference to the `summary` element of the current `details` element (if any) in a variable
@jonbca
jonbca / gist:857784
Created March 6, 2011 22:23
CSS to support details tag in un-details-savvy browsers
@import "compass/css3";
/* make details & summary display as block elements in browsers
where they're not supported (ahem... all of them). */
details, summary {
display: block;
}
/* hide the dropdown arrow if the browser supports details */
.arrow {