Aniket Narvankar

Aniket Narvankar

  • 559
  • 2.1k
  • 605.4k

Jquery blink a label

Aug 13 2015 1:41 AM
I want to blink a label on page load,how should I do it.Suppose there is a counter first it is initialized to zero,till  the counter value becomes 24 it should blink i.e show-hide-show how should I do this? Please guide me,the below code which I have written. 
 
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication3.WebForm1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript" src="Scripts/jquery-1.8.2.min.js"></script>
<script type="text/javascript" language="javascript">
function Blink() {
var i = 0;
var s;
var h;
for (i = 0; i < 25; i++) {
j = setInterval(Show, 1);
s=setInterval(Hide,2);
}
clearInterval(s);
clearInterval(h);
}
function Hide() {
$("#lblBlink").hide();
}
function Show() {
$("#lblBlink").show();
}
</script>
</head>
<body onload = "Blink();">
<form id="form1" runat="server">
<div>
<asp:Label ID="lblBlink" runat="server" Text="Blink Effect">
</asp:Label>
</div>
</form>
</body>
</html>

Answers (1)