Home > Web Front-end > JS Tutorial > JS method to achieve browser status bar text flashing effect_javascript skills

JS method to achieve browser status bar text flashing effect_javascript skills

WBOY
Release: 2016-05-16 15:34:52
Original
1849 people have browsed it

The example in this article describes the method of using JS to achieve the flashing effect of browser status bar text. Share it with everyone for your reference, the details are as follows:

Here is a demonstration of adding a text flashing effect to the status bar of your IE browser. Please see that the text in the status bar below keeps flashing. The effect may not be normal under Firefox. This code is only for IE browser.

The screenshot of the running effect is as follows:

The online demo address is as follows:

http://demo.jb51.net/js/2015/js-status-bar-txt-blink-codes/

The specific code is as follows:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>状态栏文字闪烁特效代码</TITLE>
</HEAD>
<BODY>
<script language="JavaScript">
<!--
var yourwords = "★ ★ 欢迎光临 ★ ★";
var speed = 700;
var control = 1;
function flash()
{
 if (control == 1)
  {
   window.status=yourwords;
   control=0;
  } 
 else
  {
   window.status="";
   control=1;
  }
 setTimeout("flash()",speed);
}
window.onload=flash
// -->
</script>
</BODY>
</HTML>
Copy after login

I hope this article will be helpful to everyone in JavaScript programming.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template