Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show() doesn't override class values #52

Closed
eleith opened this issue Nov 28, 2011 · 2 comments
Closed

show() doesn't override class values #52

eleith opened this issue Nov 28, 2011 · 2 comments

Comments

@eleith
Copy link

eleith commented Nov 28, 2011

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

@ded
Copy link
Owner

ded commented Nov 28, 2011

yeah, somewhere in the back of my mind, i knew this. in the meantime keep using show('block') and i'll see if there's something we can do

@rvagg
Copy link
Collaborator

rvagg commented Nov 28, 2011

See also #47

@ded ded closed this as completed Jan 12, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants