- This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
Viewing 7 posts - 1 through 7 (of 7 total)
- The forum ‘JavaScript’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › JavaScript › [jQuery] Make show/hide on anchor tags
Hey guys and gals,
I’m trying to make a quite odd menu, but to finally achieve it I need to make show() and hide() to show my anchor tags as blocks, instead of the default inline. jQuery will always show/hide the a element as inline, but I need to be a block element. Any idea if this is possible?
Thanks.
what about .css("display", "none") and .css("display", "block")?
If I do it that way, I can’t add an effect to it. Or is it possible to do some sort of animate?
It’s only displaying inline because that is what it’s original display was. If you change the display to block:
Then it will display as a block again – once it is shown through show().
Ohh I see, thanks :) However, if I need them to be initially hidden (with display: none), how can I set it to display:block instead of display: inline when it appears back again?
CSS:
start off your jQuery with:
Thanks, sometimes I get lost in basic stuff :P Was trying to avoid .hide() that way, because it sometimes takes effect in front of the end user, resulting in a not so nice experience, but I’ll be using it anyways.