ERP俱乐部
ERP爱好者、ERP从业者互相交流、互相学习的乐园;我们的愿景是成为全球一流的中文ERP(Enterprise Resource Planning)交流平台
网站首页 论坛首页 搜索 用户列表 FAQ 注册 登录  
ERP俱乐部 -> Microsoft专栏 -> Visual C# -> 看看javaScript还能这样玩
  看看javaScript还能这样玩
帖子发起人: 半神   发起时间: 2009-01-07 08:25 下午   回复数: 2
? 上一主题 下一主题 ?
楼主
  2009-01-07, 08:25 下午
半神 离线,最后访问时间: 2013/6/5 18:59:05 半神

发帖数前25位

超级管理员
职务: 超级管理员
80级
等级: 80级
注册: 2008年1月6日
区域: 华南
经验: 1,267
积分: 1,131
精华: 2
发贴: 590
排名: 26
Site AdministratorsGlobal ModeratorsSite ModeratorsSite Registered Users培训学员(MM学员服务区-北京200708班) 培训学员(FI学员服务区-深圳200805班) 每日发帖之星
看看javaScript还能这样玩
 

<html>
  <head>
    <title></title>
  </head>
  <body bgcolor="#000000" text="#FFFFFF">
    <p id="idText" style="color:rgb(255,255,255)"></p>
    <p id="idInsertObject"></p>  
  </body>
  <script languate="VBScript" type="text/VBScript">
    Dim pubOrbits_X(255, 255)
    Dim pubOrbits_Y(255, 255)
    Dim pubOrbits_Z(255, 255)
    Dim pubSpanObjects(255)
    Dim pubColors(255, 255)
    Dim pubStepOn
    Dim pubWorkOn
    Dim pubX
    Dim pubY
    Dim pubScale
    Dim pubTime
    Dim pubOnTimer
    Dim pubTimeout

    Sub window_onload()
      pubTimeout = 33
      CreateObjects
      CreateColors
      CreateOrbits pubOrbits_X, pubOrbits_Y, pubOrbits_Z
      NewSkyrocket
      ShowSkyrocket
    End Sub

    Sub NewSkyrocket()
      pubX= 300
      pubY= 300
      pubScale = 2 'Rnd * 2 + 2
      pubTime = window.setTimeout("ShowSkyrocket", 1)
    End Sub
       
    Sub ShowSkyrocket()
      If pubWorkOn <= 255 Then
          pubWorkOn = (pubWorkOn + 1) mod 256
          ViewObjects pubScale, pubWorkOn, pubX, pubY
          pubTime = window.setTimeout("ShowSkyrocket", 33)
        Else
          pubWorkOn = 0
          ViewObjects pubScale, pubWorkOn, pubX, pubY
          NewSkyrocket
      End If
    End Sub
   
    Sub ViewObjects(pScale, pIndex, pX, pY)
      For tIndex = 0 To 255
        If pIndex < 256 Then
          With pubSpanObjects(tIndex).style
            tLevel = pubOrbits_Z(tIndex, pIndex) + 200
            tSize = tLevel * 10 / 200
            tLight = tLevel * 170 / 200
            tSizeAdd = tSize / 2
            tScale = pScale * (tSize / 10)
            .color = pubColors(tIndex, tLight)
            .top = pubOrbits_Y(tIndex, pIndex) * tScale + pY - tSizeAdd
            .left = pubOrbits_X(tIndex, pIndex) * tScale + pX - tSizeAdd
            .fontsize = tSize & "px"
            .zindex = tSize
          End With
        End If
      Next
    End Sub

    Sub CreateObjects()
      For tIndex = 0 To 255
        Set pubSpanObjects(tIndex) = document.createElement("SPAN")
        With pubSpanObjects(tIndex)
          .innerText = "*"
        End With
        With pubSpanObjects(tIndex).style
          .position = "absolute"
          .color = Rgb(0, 0, 0)
        End With
        idInsertObject.insertAdjacentElement "beForeEnd", pubSpanObjects(tIndex)
      Next
    End Sub

    Sub CreateColors()
      Dim tColor(2)
      For tColorIndex = 0 To 255
        tColor(0) = Rnd : tColor(1) = Rnd : tColor(2) = Rnd       
        tColor(Int(Rnd*3)) = 1
        For tLightIndex = 0 To 255
          pubColors(tColorIndex, tLightIndex) = rgb(tColor(0) * tLightIndex, tColor(1) * tLightIndex, tColor(2) * tLightIndex)
        Next
      Next
    End Sub

    Sub CreateOrbits(pOrbits_X(), pOrbits_Y(), pOrbits_Z())
      tR = 100
      For tOrbitsIndex = 0 To 255
        tRndAgV = Int(Rnd * 360)
        tRndAgP = Int(Rnd * 360)
        For tLi = 0 To 255
          tAgP = (tRndAgP + (tLi * 360) \ 255) Mod 360
          SphereLocate tR, tRndAgV, tAgP, tX, tY, tZ
          pOrbits_X(tOrbitsIndex, tLi) = tY
          pOrbits_Y(tOrbitsIndex, tLi) = tZ
          pOrbits_Z(tOrbitsIndex, tLi) = tX
        Next
      Next
    End Sub
 
    Sub SphereLocate(pR, pAgV, pAgP, pX, pY, pZ)
      tRdV = Radian(pAgV)
      tRdP = Radian(pAgP)
      pX = SphereX(pR, tRdV, tRdP)
      pY = SphereY(pR, tRdV, tRdP)
      pZ = SphereZ(pR, tRdV)
    End Sub

    Function SphereX(pR, pRdV, pRdP)
      SphereX = pR * Sin(pRdV) * Cos(pRdP)
    End Function

    Function SphereY(pR, pRdV, pRdP)
      SphereY = pR * Sin(pRdV) * Sin(pRdP)
    End Function

    Function SphereZ(pR, pRdV)
      SphereZ = pR * Cos(pRdV)
    End Function
   
    Function Radian(pAngle)
      Radian =pAngle * 71 / 4068
    End Function
  </script>
</html>

 


开源时代的到来,对与技术人员是一个巨大的考验



QQ:876162454


分享按钮 IP 地址: 已登录   来自: 已登录    返回顶部
第 2 楼
  2009-01-07, 08:26 下午
半神 离线,最后访问时间: 2013/6/5 18:59:05 半神

发帖数前25位

超级管理员
职务: 超级管理员
80级
等级: 80级
注册: 2008年1月6日
区域: 华南
经验: 1,267
积分: 1,131
精华: 2
发贴: 590
排名: 26
Site AdministratorsGlobal ModeratorsSite ModeratorsSite Registered Users培训学员(MM学员服务区-北京200708班) 培训学员(FI学员服务区-深圳200805班) 每日发帖之星
Re: 看看javaScript还能这样玩
 
将这个直接复制到一个"记事本"里面,然后将.txt的后缀名改成.html就可以看到效果了
开源时代的到来,对与技术人员是一个巨大的考验



QQ:876162454


IP 地址: 已登录   来自: 已登录    返回顶部
第 3 楼
  2009-01-22, 10:21 上午
Amanda0929 离线,最后访问时间: 2009/9/22 16:18:06 Amanda0929

发帖数前75位

90级
等级: 90级
注册: 2007年7月27日
经验: 2,065
积分: 1,114
精华: 0
发贴: 232
排名: 17
Site Registered Users培训学员(ABAP学员服务区-深圳200607班) 培训学员(SD学员服务区-北京200703班) 培训学员(BASIS学员服务区-上海200707班) 培训学员(CO学员服务区-深圳200709班)  培训学员(BW学员服务区-上海200710黄金周班) 培训学员(FI学员服务区-上海200709班) 培训学员(MM学员服务区-深圳200711班) 培训学员(HR学员服务区-上海200711班) 培训学员(PP学员服务区-上海200806班) 每日发帖之星每日发帖之星每日发帖之星每日发帖之星每日发帖之星每日发帖之星每日发帖之星每日发帖之星每日发帖之星每日发帖之星每日发帖之星
Re: 看看javaScript还能这样玩
 
呵呵挺有意思的.
tel:0755-26523860;13714519181

fax:0755-26523890

email: chun.li@yok.com.cn

MSN:yoksales@hotmail.com QQ:819470295

http://www.erpclub.org
分享按钮 IP 地址: 已登录   来自: 已登录    返回顶部
 第 1 页 总共 1 页 [共有 3 条记录]
ERP俱乐部 -> Microsoft专栏 -> Visual C# -> 看看javaScript还能这样玩
(C)Copyright 2005-2020 www.erpclub.org All Rights Reserved.
Tel:+86-755-26444630
Email:webmaster@yok.com.cn