var iNum,data; var el = document.getElementById("aDiv"); var angle=0,angles=0; var pi = Math.PI; function degToRad(x){return( x/(360/(2*pi)));} function radToDeg(x){return( x*(360/(2*pi)));} function rotate(){ var rad = degToRad(angle); costheta = Math.cos(rad); sintheta = Math.sin(rad); //var el = document.getElementById(name); if(el.filters) { el.style.filter = "progid:DXImageTransform.Microsoft.Matrix()"; el.filters.item("DXImageTransform.Microsoft.Matrix").SizingMethod = "auto expand"; el.filters.item("DXImageTransform.Microsoft.Matrix").FilterType = "bilinear"; el.filters.item("DXImageTransform.Microsoft.Matrix").M11 = costheta; el.filters.item("DXImageTransform.Microsoft.Matrix").M12 = -sintheta; el.filters.item("DXImageTransform.Microsoft.Matrix").M21 = sintheta; el.filters.item("DXImageTransform.Microsoft.Matrix").M22 = costheta; } else if(window.navigator.userAgent.indexOf("Firefox")>=1) { el.style.MozTransform = "rotate("+angle+"deg)"; } else if(window.navigator.userAgent.indexOf("Chrome")>=1) { el.style.WebkitTransform = "rotate("+angle+"deg)"; } else if(window.navigator.userAgent.indexOf("Safari")>=1){ el.style.WebkitTransform = "rotate("+angle+"deg)"; } else if(window.navigator.appName=="Opera"){ el.style.OTransform = "rotate("+angle+"deg)"; } } 来源:深圳网站建设公司(www.jihai.com) |
js转盘抽奖部分代码原理
最新推荐文章于 2023-02-20 11:37:44 发布