Home > Web Front-end > JS Tutorial > body text

JS实现IE状态栏文字缩放效果代码_javascript技巧

WBOY
Release: 2016-05-16 15:35:30
Original
1315 people have browsed it

本文实例讲述了JS实现IE状态栏文字缩放效果代码。分享给大家供大家参考,具体如下:

这里演示状态栏文字缩放变化效果,同样基于JavaScript技术,虽然很不起眼的小特效,不过对学习JS来说,还是很有用的。本效果直接运行可能看不到效果,你可以复制代码保存成一个HTML文件,双击后运行可看到效果。

运行效果截图如下:

在线演示地址如下:

http://demo.jb51.net/js/2015/js-ie-ztl-txt-style-demo/

具体代码如下:

<HTML>
<HEAD>
<TITLE>状态栏文字缩放出现</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<SCRIPT language=JavaScript>
<!-- Begin
timeID = 5;
stcnt = 11;
msg = "<<I love shenlong!!!>>";
wmsg = new Array(33);
wmsg[0] = msg;
blnk = "";
for (i = 1; i < 32; i++) {
b = blnk.substring(0, i);
wmsg[i] = "";
for (j = 0; j < msg.length; j++) wmsg[i] = wmsg[i] + msg.charAt(j) + b;
}
function wiper() {
if (stcnt > -1) str = wmsg[stcnt]; 
else str = wmsg[0];
if (stcnt-- < -40) stcnt = 31;
status = str;
clearTimeout(timeID);
timeID = setTimeout("wiper()", 150);
}
// End -->
</SCRIPT>
</HEAD>
<BODY bgColor=#fef4d9 onload=wiper()>
<BR>
<CENTER>
<TABLE borderColor=#FFFF00 border=5 borderlight="green">
 <TBODY>
 <TR>
 <TD align=middle>状态栏为效果显示区!</TD>
 </TR></TBODY></TABLE></CENTER>
</BODY>
</HTML>
Copy after login

希望本文所述对大家JavaScript程序设计有所帮助。

Related labels:
js
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!