ded/bonzo — Issue #52: show() doesn't override class values
Author: eleith
Created: 2011-11-28 01:55:31+00:00
State: open

if a div has a class `.hide` which sets `display:none` then bonzo's `show()` will simply set `el.style.display = ""`

this will not override the class's value.

instead i have to call `show('block')` to get it to work. jquery has an overly complicated method allowing it to properly set the default display to elements (since sometimes showing means making the display inline, inline-block, table-row, etc etc....)

css3 has an `initial` value that works on all attributes (https://developer.mozilla.org/en/CSS/initial) which would be perfect in this scenario, but the browser support is limited right now.

you could take the 80% approach and set the display to `block` and get most of the way there.

i'm just manually setting mine as it isn't a big deal, but it is a quick 'gotcha' for those new to bonzo coming from jquery