tags:

views:

25

answers:

1

I would like to be able to do this:

$(".panel").visible = true;

but this doesnt work

+4  A: 

For the display CSS property, use .show(), .hide() or .toggle() to affect whether it displays, like this:

$(".panel").show();
//or to hide:
$(".panel").hide();
//toggle show/hide
$(".panel").toggle();
//or show/hide based on boolean:
$(".panel").toggle(bool);

For the visibility CSS property, you need to set it manually (jQuery is mostly built around display), using .css() like this:

$(".panel").css("visibility", "visible");
//or:
$(".panel").css({ visibility: "visible"});
Nick Craver
Thanks, but this is not a css property i am using vb.net
bill
its a div property
bill
@bill - In that case you *can't* show it from jQuery, since it's not even in the page the client has no knowledge of it. Instead of `Visible="false"` in the server tag, you need `style="display: none;"` so it still renders in the page. To be a bit clearer, it's not a `<div>` property, it's an ASP.Net control property that controls rendering.
Nick Craver