当前位置:首页 > 网站应用 > 正文内容

js+css3文字闪光滑过动画特效

cjw1232年前 (2024-03-03)网站应用4230
<!DOCTYPE html>    
<html>    
<head>    
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />    
<meta http-equiv="X-UA-Compatible" content="IE=edge">    
<title>js+css3文字闪光滑过动画特效</title>    
</head>    
<body>    
<style>    
body{background:#222;text-align:center;}    
#phone{width:1100px;margin:0 auto;display:inline-block;margin:50px;font-size:150px;font-weight:bold;color:rgba(255,255,255,0.3); background:-webkit-linear-gradient(-30deg,rgba(255,255,255,0) 100px,rgba(255,255,255,1) 180px,rgba(255,255,255,1) 240px,rgba(255,255,255,0) 300px) -300px 0 no-repeat; -webkit-background-clip:text;}    
</style>    
<div id="phone">追求完美-BLOG</div>    
<script language="javascript">    
var ph=document.getElementById("phone");    
var otime=null;    
var num=-300;    
function tomove(){    
	otime=setInterval(function (){    
		num+=10;    
		if(num==1100)    
		{    
			num=-300;    
			clearInterval(otime);    
		}    
		ph.style.backgroundPosition=num+"px 0px";    
		},20)    
	}    
tomove();    
setInterval(function(){    
	tomove();	    
},3000);    
</script>    
</body>    
</html>


扫描二维码推送至手机访问。

版权声明:本文由追求完美发布,如需转载请注明出处。

本文链接:https://www.cjw123.com/blog/?id=74

分享给朋友:

相关文章

html meta标签屏蔽搜索引擎的用法

html页面中的 meta 标签可以用来识别搜索引擎的蜘蛛类型,可以规定meta标签所在的html页面是否被蜘蛛抓取,下面是这个meta标签的用法,大家可以借鉴一下。搜索引擎的 meta 标签的解析下面是meta标签对搜索引擎的解析<meta name='robot...

纯css实现弹出图层背景变灰特效

<style> .bg{position:absolute;z-index:999;filter:alpha(opacity=50);background:#666;opacity: 0.5;-moz-opacity: 0.5;left:0;top:0;height...

html中表table行循环滚动,类似车次、航班动态

<HTML> <meta charset="utf-8"> <HEAD> <TITLE>滚动表格</TITLE> <!--css样式是锁定表头不动的--> <style>&nb...

灯光追踪

<!DOCTYPE html> <html lang="en"> <head>     <meta charset="UTF-8">...

瞌睡小鸟按钮特效

<!DOCTYPE html> <html lang="en">   <head>     <title>瞌睡小鸟按钮特效</title&g...

纯css实现文字音符跳动效果

通过纯css实现文字音符跳动效果。点下面的运行可以查看效果!<!doctype html><html>     <head>        ...

发表评论

访客

看不清,换一张

◎欢迎参与讨论,请在这里发表您的看法和观点。