多语言展示
当前在线:428今日阅读:99今日分享:20

js实现立体球面标签效果

js实现立体球面标签效果
工具/原料

adobe dreamweaver

方法/步骤
1

新建html文档。

3

书写css代码。body { background: url(../images/index.png) no-repeat center 230px #000; }#div1 { position: relative; width: 450px; height: 450px; margin: 20px auto 0; }#div1 a { position: absolute; top: 0px; left: 0px; font-family: Microsoft YaHei; color: #fff; font-weight: bold; text-decoration: none; padding: 3px 6px; }#div1 a:hover { border: 1px solid #eee; background: #000; }#div1 .blue { color: blue; }#div1 .red { color: red; }#div1 .yellow { color: yellow; }p { font: 16px Microsoft YaHei; text-align: center; color: #ba0c0c; }p a { font-size: 14px; color: #ba0c0c; }p a:hover { color: red; }

4

书写并添加js代码。var radius = 120;var dtr = Math.PI/180;var d=300;var mcList = [];var active = false;var lasta = 1;var lastb = 1;var distr = true;var tspeed=10;var size=250;var mouseX=0;var mouseY=0;var howElliptical=1;var aA=null;var oDiv=null;window.onload=function (){ var i=0; var oTag=null; oDiv=document.getElementById('div1'); aA=oDiv.getElementsByTagName('a'); for(i=0;ivItem2.cz) { return -1; } else if(vItem1.cz

5

代码整体结构。

6

查看效果。

推荐信息