純js代碼制作的網(wǎng)頁(yè)時(shí)鐘特效【附實(shí)例】
純js代碼制作的網(wǎng)頁(yè)時(shí)鐘特效,需要的碼農(nóng)可以拿去看一下。給大家做個(gè)參考。
<HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=gb2312"> <META content="MSHTML 6.00.6000.16414" name=GENERATOR></HEAD> <BODY> <DIV style="LEFT: 155px; WIDTH: 400px; ZOOM: 1; POSITION: absolute; TOP: 133px; HEIGHT: 300px"> <DIV id=bg style="LEFT: -22px; WIDTH: 150px; ZOOM: 1.5; POSITION: absolute; TOP: -57px; HEIGHT: 150px"><IMG style="Z-INDEX: 22; WIDTH: 129px; HEIGHT: 129px" src="http://img.jbzj.com/upload/novelty.gif"> </DIV> <DIV id=h style="PADDING-RIGHT: 5px; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; WIDTH: 129px; PADDING-TOP: 5px; POSITION: absolute; HEIGHT: 129px"><IMG style="Z-INDEX: 22; WIDTH: 129px; HEIGHT: 129px" src="http://img.jbzj.com/upload/novelty_h.gif"> </DIV> <DIV id=m style="PADDING-RIGHT: 5px; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; WIDTH: 129px; PADDING-TOP: 5px; POSITION: absolute; HEIGHT: 129px"><IMG style="Z-INDEX: 22; WIDTH: 129px; HEIGHT: 129px" src="http://img.jbzj.com/upload/novelty_m.gif"> </DIV> <DIV id=s style="PADDING-RIGHT: 5px; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; WIDTH: 129px; PADDING-TOP: 5px; POSITION: absolute; HEIGHT: 129px"><IMG style="Z-INDEX: 22; WIDTH: 129px; HEIGHT: 129px" src="http://img.jbzj.com/upload/novelty_s.gif"> </DIV> <DIV id=dot style="PADDING-RIGHT: 5px; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; WIDTH: 129px; PADDING-TOP: 5px; POSITION: absolute; HEIGHT: 129px"><IMG style="Z-INDEX: 22; WIDTH: 129px; HEIGHT: 129px" src="http://img.jbzj.com/upload/novelty_dot.gif"> </DIV> <DIV> <SCRIPT> //oObj input requires that a matrix filter be applied. //deg input defines the requested angle of rotation. var deg2radians = Math.PI * 2 / 360; function MatrixFilter(obj) { if(!obj.filters)return; //alert(obj.filters.item(0)); var Matrix; for(p in obj.filters) { if(p=="DXImageTransform.Microsoft.Matrix")Matrix=obj.filters["DXImageTransform.Microsoft.Matrix"]; } if(!Matrix) { obj.style.filter+="progid:DXImageTransform.Microsoft.Matrix()"; } Matrix=obj.filters["DXImageTransform.Microsoft.Matrix"]; this.equal=function(Matrix2D_x) { if(Matrix2D_x.M11)Matrix.M11 = Matrix2D_x.M11; if(Matrix2D_x.M12)Matrix.M12 = Matrix2D_x.M12; if(Matrix2D_x.M21)Matrix.M21 = Matrix2D_x.M21; if(Matrix2D_x.M22)Matrix.M22 = Matrix2D_x.M22; } if(arguments[1])this.equal(arguments[1]); this.Rotate=function(deg) { rad = deg * deg2radians; costheta = Math.cos(rad); sintheta = Math.sin(rad); var d=new Matrix2D(costheta,-sintheta,sintheta,costheta); this.equal(Matrix2D.Mul(Matrix,d)); } this.RotateTo=function(deg) { rad = deg * deg2radians; costheta = Math.cos(rad); sintheta = Math.sin(rad); var d=new Matrix2D(costheta,-sintheta,sintheta,costheta); this.equal(d); } this.RotateAt=function(deg,sx,sy) { rad = deg * deg2radians; costheta = Math.cos(rad); sintheta = Math.sin(rad); var d=new Matrix2D(costheta,-sintheta,sintheta,costheta); var x=sx-Matrix.Dx; var y=sy-Matrix.Dy; this.MoveTo(x*costheta+y*sintheta-x,-x*sintheta+y*costheta-y); this.equal(Matrix2D.Mul(Matrix,d)); } this.RotateToAt=function(deg,sx,sy) { rad = deg * deg2radians; costheta = Math.cos(rad); sintheta = Math.sin(rad); var d=new Matrix2D(costheta,-sintheta,sintheta,costheta); var x=sx; var y=sy; this.MoveTo(x-(x*costheta-y*sintheta),-(x*sintheta+y*costheta-x)); this.equal(d); } this.MoveTo=function(sx,sy) { Matrix.Dx=sx; Matrix.Dy=sy; } this.toMatrix2D=function() { return new Matrix2D(Matrix.M11,Matrix.M12,Matrix.M21,Matrix.M22); } this.ZoomBy=function(sx,sy) { var d=new Matrix2D(sx,0,0,sy); this.equal(Matrix2D.Mul(Matrix,d)); } this.toString=function() { return ""+Matrix.M11+" "+Matrix.M12+"\n"+Matrix.M21+" "+Matrix.M22+"\n" } //Matrix.SizingMethod='clip to original'; //this.fnSetRotation(30); //alert(Matrix.M11); //alert(obj.filters["DXImageTransform.Microsoft.Matrix"]); } function Matrix2D() { this.M11 = arguments[0]||1; this.M12 = arguments[1]||0; this.M21 = arguments[2]||0; this.M22 = arguments[3]||1; this.Mul_Matrix2D=function(Matrix2D_b) { var r=new Matrix2D(); r=Matrix2D.Mul(this,Matrix2D_b); return r; } this.toString=function() { return ""+this.M11+" "+this.M12+"\n"+this.M21+" "+this.M22+"\n" } } Matrix2D.Mul=function(Matrix2D_a,Matrix2D_b) { var r=new Matrix2D(); r.M11=Matrix2D_a.M11*Matrix2D_b.M11+Matrix2D_a.M12*Matrix2D_b.M21; r.M12=Matrix2D_a.M11*Matrix2D_b.M12+Matrix2D_a.M12*Matrix2D_b.M22; r.M21=Matrix2D_a.M21*Matrix2D_b.M11+Matrix2D_a.M22*Matrix2D_b.M21; r.M22=Matrix2D_a.M21*Matrix2D_b.M12+Matrix2D_a.M22*Matrix2D_b.M22; return r; } var ms=new MatrixFilter(s); var mm=new MatrixFilter(m); var mh=new MatrixFilter(h); var i=1; setInterval("ms.RotateToAt((new Date()).getSeconds()*6+6,69,69)",500); setInterval("mm.RotateToAt((new Date()).getMinutes()*6+6,69,69)",500); setInterval("mh.RotateToAt(((new Date()).getHours()+(new Date()).getMinutes()/60)*30,69,69)",500); //mf.MoveTo(30,70); //mf.ZoomBy(1.5,1.5); //mf.ZoomBy(1.5,1.5); //alert(mf.toMatrix2D()); //alert(Matrix2D.Mul(m2d1,m2d2)); //fnSetRotation(oDiv.filters.item(0),30); </SCRIPT> </DIV></DIV></BODY></HTML>
以上這篇純js代碼制作的網(wǎng)頁(yè)時(shí)鐘特效【附實(shí)例】就是小編分享給大家的全部?jī)?nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。
- 利用css+原生js制作簡(jiǎn)單的鐘表
- 詳解JavaScript的Date對(duì)象(制作簡(jiǎn)易鐘表)
- html5 canvas js(數(shù)字時(shí)鐘)實(shí)例代碼
- js實(shí)現(xiàn)一個(gè)簡(jiǎn)單的數(shù)字時(shí)鐘效果
- JS實(shí)現(xiàn)的網(wǎng)頁(yè)倒計(jì)時(shí)數(shù)字時(shí)鐘效果
- 超級(jí)可愛純js網(wǎng)頁(yè)時(shí)鐘
- js實(shí)現(xiàn)簡(jiǎn)單秒表走動(dòng)的時(shí)鐘特效
- js時(shí)鐘翻牌效果實(shí)現(xiàn)代碼分享
- JS 實(shí)現(xiàn)倒計(jì)時(shí)數(shù)字時(shí)鐘效果【附實(shí)例代碼】
- JS實(shí)現(xiàn)簡(jiǎn)易刻度時(shí)鐘示例代碼
- 五步輕松實(shí)現(xiàn)JavaScript HTML時(shí)鐘效果
- 原生JS實(shí)現(xiàn)的簡(jiǎn)單小鐘表功能示例
相關(guān)文章
JavaScript中判斷整數(shù)的多種方法總結(jié)
這篇文章主要介紹了JavaScript中判斷整數(shù)的多種方法總結(jié),本文總結(jié)了5種判斷整數(shù)的方法,如取余運(yùn)算符判斷、Math.round、Math.ceil、Math.floor判斷等,需要的朋友可以參考下2014-11-11JavaScript在網(wǎng)頁(yè)中畫圓的函數(shù)arc使用方法
這篇文章主要介紹了JavaScript在網(wǎng)頁(yè)中畫圓的函數(shù)arc使用方法的相關(guān)資料,需要的朋友可以參考下2015-11-11js實(shí)現(xiàn)的簡(jiǎn)單radio背景顏色選擇器代碼
這篇文章主要介紹了js實(shí)現(xiàn)的簡(jiǎn)單radio背景顏色選擇器代碼,利用鼠標(biāo)事件及頁(yè)面元素動(dòng)態(tài)操作實(shí)現(xiàn)頁(yè)面背景顏色的改變功能,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-08-08關(guān)于JavaScript中的數(shù)組方法和循環(huán)
這篇文章主要介紹了關(guān)于JavaScript中的數(shù)組方法和循環(huán),具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2022-09-09js實(shí)現(xiàn)年月日表單三級(jí)聯(lián)動(dòng)
這篇文章主要為大家詳細(xì)介紹了js實(shí)現(xiàn)年月日表單三級(jí)聯(lián)動(dòng),生日欄表單三級(jí)聯(lián)動(dòng),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-03-03網(wǎng)頁(yè)禁止鼠標(biāo)左右鍵功能的簡(jiǎn)單代碼
本篇文章介紹與演示網(wǎng)頁(yè)禁止鼠標(biāo)左右鍵的實(shí)例代碼,需要的朋友可以參考一下2013-06-06Javascript中toFixed計(jì)算錯(cuò)誤(依賴銀行家舍入法的缺陷)解決方法
這篇文章主要介紹了Javascript中toFixed計(jì)算錯(cuò)誤(依賴銀行家舍入法的缺陷)解決方法,非常具有實(shí)用價(jià)值,需要的朋友可以參考下2017-08-08JavaScript實(shí)現(xiàn)點(diǎn)擊改變圖片形狀(transform應(yīng)用)
這篇文章主要為大家詳細(xì)介紹了JavaScript實(shí)現(xiàn)點(diǎn)擊改變圖片形狀,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2021-04-04JS實(shí)現(xiàn)全屏預(yù)覽F11功能的示例代碼
這篇文章主要介紹了JS實(shí)現(xiàn)全屏預(yù)覽F11功能的示例代碼,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來(lái)看看吧2018-07-07