How to create a fading label in JQuery / ASP.NET after a button press

后端 未结 4 678
面向向阳花
面向向阳花 2021-01-22 13:59

I think that this should be pretty easy but I\'m not quite sure how to wire things up.

I have a page on which the user can define a query. When done, the user enters a

4条回答
  •  情书的邮戳
    2021-01-22 14:54

    Start the asp label text as empty.

    
    

    Then you can fade out the label every page load and set the text of the asp label after hitting the button.

    Protected Sub btn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn.Click
      myLabel.Text = "You hit the button"
    End Sub
    
        $(document).ready(function() {
            $('#myLabel').fadeOut(3000, function() {
                $(this).html(""); //reset the label after fadeout
            });
        });
    

提交回复
热议问题