tags:

views:

47

answers:

3

i able to show a status message and works without any issue but there is one usability issue.

once it shows the message the div disappears but it still holds the space, how can i remove that space or move up the my label/textbox up?

   <div id="status"></div>   

    <asp:Label runat="server" ID='Label1' >Name:</asp:Label>
    <asp:TextBox ID="txtName" runat='server'></asp:TextBox>
    ......
    ......

script:

$("#status").fadeTo(500, 1, function() { $(this).html("You are now registered!").fadeTo(7000, 0); })
+2  A: 

$("#status").hide()

Would set the display attribute to 'none' and should collapse the div like you want.

HurnsMobile
does not display the status message now and the space is still there.
Abu Hamzah
+1  A: 

You can use the .hide() function or change the DIV width and height to 0 using .css()

Cristian
+3  A: 

Add another callback after the fadeout to hide the div.

$("#status").fadeTo(500, 1, function() { $(this).html("You are now registered!").fadeTo(7000, 0, function() { $(this).hide() } ); })

(New code is the last callback, function() { $(this).hide() } at the end

Simen Echholt