Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Flag Example in jQuery
WhatsApp
Mithilesh Kumar
Jul 03
2016
6
k
0
1
<html >
<head>
<title></title>
<script src=
"Scripts/jquery-2.1.1.js"
type=
"text/javascript"
></script>
<script type=
"text/javascript"
>
$(document).ready(
function
(){
$(
"#divTitle"
).addClass(
"style1"
);
var
flag=
true
;
function
blinkstyle(){
if
(flag==
true
)
{
if
($(
"#divTitle"
).hasClass(
"style1"
))
$(
"#divTitle"
).removeClass(
"style1"
);
$(
"#divTitle"
).addClass(
"style2"
);
flag =
false
;
}
else
{
if
($(
"#divTitle"
).hasClass(
"style2"
))
$(
"#divTitle"
).removeClass(
"style2"
);
$(
"#divTitle"
).addClass(
"style1"
);
flag =
true
;
}
}
window.setInterval(blinkstyle,200);
});
</script>
<style type=
"text/css"
>
.style1 {
text-align:center;
width:70%;
height:100px;
line-height:100px;
background-color:red;
color:white;
font-family:Tahoma;
font-size:60px;
border:5px solid green;
border-radius:10px;
box-shadow:gray 10px 15px;
}
.style2 {
text-align:center;
width:70%;
height:110px;
line-height:95px;
background-color:yellow;
color:red;
font-family:
'Monotype Corsiva'
;
font-size:100px;
border:7px solid green;
border-radius:20px;
box-shadow:green 10px 15px;
}
</style>
</head>
<body>
<form id=
"form1"
runat=
"server"
>
<div id=
"divTitle"
>
<b>Mithilesh kumar singh</b>
</div>
</form>
</body>
</html>
JQuery
HTML
Up Next
Flag Example in jQuery