Border Blink Using JQuery
<div class="divborder"></div>
/* CSS Class */
.divborder
{
/*or other element you want*/
animation-name: blink;
animation-duration: .8s;
animation-timing-function: step-end;
animation-iteration-count: infinite;
animation-direction: alternate;
}
/* JQuery Code */
$(function () {
var flag = true;
setInterval(function () {
if (flag) {
$(".divborder").css('border', '1px solid #007baf');
flag = false;
}
else {
$(".divborder").css('border', '1px solid #d9d9d9');
flag = true;
}
}, 500);
});
<div class="divborder"></div>
/* CSS Class */
.divborder
{
/*or other element you want*/
animation-name: blink;
animation-duration: .8s;
animation-timing-function: step-end;
animation-iteration-count: infinite;
animation-direction: alternate;
}
/* JQuery Code */
$(function () {
var flag = true;
setInterval(function () {
if (flag) {
$(".divborder").css('border', '1px solid #007baf');
flag = false;
}
else {
$(".divborder").css('border', '1px solid #d9d9d9');
flag = true;
}
}, 500);
});
No comments:
Post a Comment