js制作一个有趣波浪浮动特效

3周前 (04-23 17:19)阅读18回复0
大陆
大陆
  • 管理员
  • 发消息
  • 注册排名1
  • 经验值4494
  • 级别管理员
  • 主题898
  • 回复2
楼主

纯js制作一个很有意思的波浪起伏特效,有些网站上面就需要用到这种特效,可运行代码看效果或根据自己的需求来修改。

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="keywords" content="武鸣人网站,武鸣信息网,武鸣本地网,武鸣信息资源平台,减肥,健身,励志,励志语录,js特效,网页特效,www.wuming.ren">
<meta name="description" content="欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。">
<title>js制作一个有趣波浪浮动特效_武鸣人</title>
<script>
 var defaultString=".........................";
 parentID="area_wwwwumingren";   
 vala=160; 
 valc=255; 
 cc1=0;  
 cc2=0; 
 fontsize=70;  
 posleft=120;  
 postop=50;  
  function q1() {
  for(i=0;i<7;i++) {
node=document.getElementById(parentID);
beforediv=document.createElement("DIV");
   cc1=255*(i/11);
   cc2=160*(i/11);
      gfx1=parseInt(vala-cc2);  
      gfx2=parseInt(valc-cc1);  
   str="position:absolute;top:"+postop+"px;left:"+posleft+"px;color:rgb("+gfx1+","+gfx1+","+gfx2+");width:260px;height:100px;font-size:"+fontsize+"pt;";
//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
   if (navigator.userAgent.indexOf("Gecko")>-1)
    beforediv.setAttribute("style",str);
   else
    beforediv.style.cssText = str;
    beforediv.setAttribute("id","object"+i);
   newText=document.createTextNode(defaultString);
   beforediv.appendChild(newText);
   node.appendChild(beforediv);
   fontsize+=2;
   posleft+=5;
   postop-=(3-((i/20)*2));
  }
setTimeout("a3danimation()",100); 
}
//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
 ox=100;    
 oy=100;  
 pi=3.141516*2;  
 ccounter=0; 
 ww=10;   
 function a3danimation() {
  ww-=.1;   
  ccounter++;
    if(ccounter<350) {
   for(i=0;i<7;i++) {
    pis=pi*(ccounter/70)+(i/ww);
    posx=i*10+ox-20+(Math.cos(pis)*5*i*ww/20);
    posy=oy+(Math.sin(pis)*10*i*ww/5);
    document.getElementById("object"+i).style.left=posx+"px";
    document.getElementById("object"+i).style.top=posy+"px";
   }
   setTimeout("a3danimation()",30);
  } else {
   ccounter=0;
   ww=10;
   setTimeout("a3danimation()",30);
  }
 }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
</script>
</head>
<body onload="q1()" bgcolor="#a0a0ff" text="white">
<a href="https://www.wuming.ren">武鸣人</a>,各种信息资源免费发布,分享励志语录经典短句,减肥健身常识,各种js特效代码。网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)<hr>
<!--欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。-->
<script type="text/javascript" src="https://www.wuming.ren/ad/tc.js"></script>
<script type="text/javascript" src="https://www.wuming.ren/ad/a.js"></script>
<div id="area_wwwwumingren" style="position:absolute;left:96px;top:60px;color:rgb(0,0,255)">
</div>
</body>
</html>


0
0
收藏0
回帖

js制作一个有趣波浪浮动特效 期待您的回复!

取消
载入表情清单……
载入颜色清单……
插入网络图片

取消确定

图片上传中
编辑器信息
提示信息