Monday, 20 June 2011

Open up hidden HTML DIV using jQuery

On of the Web UIs which I have worked on recenlty had a requirement to open-up a DIV when it is hidden and show a message to the user in response to a button click (it can be any other user action). I did it using the following code


if ($("#div").is(":hidden")) {
$("#div").slideDown('slow', function () {
alert("Your message goes here");
}
);


$("#div").is(":hidden") returns true or false depending on the DIVs visibility.

No comments:

Post a Comment