亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

一款超酷的js+css3實(shí)現(xiàn)的3D標(biāo)簽云特效兼容ie7/8/9

  發(fā)布時間:2013-11-18 17:01:51   作者:佚名   我要評論
一款超酷的js+css3實(shí)現(xiàn)的3D標(biāo)簽云特效,兼容ie7/8/9,看慣了flash的,來試試這個吧,下面有個不錯的示例,希望大家不要錯過

今天給大家?guī)硪豢畛岬膉s+css3實(shí)現(xiàn)的3D標(biāo)簽云特效,

看慣了flash的,來試試這個吧。

ie7,8,9兼容哦~

html如下:

復(fù)制代碼
代碼如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<title>超酷的js+css3實(shí)現(xiàn)的3D標(biāo)簽云特效,前端愛好者www.250ba.com</title>
<style>
body{ font-family:"微軟雅黑", Arial, sans-serif;} #main{border:none; background:none;}
body,ul,li,h1,h2,h3,p,form{margin:0;padding:0;}body{background:#fbfbfb;color:#444;font-size:14px;}</p> <p>a{color:#444;text-decoration:none;}a:hover{color:red;}</p> <p>#tagscloud{width:240px;height:250px;position:relative;font-size:12px;color:#333;margin:20px auto 0;text-align:center;}
#tagscloud a{position:absolute;top:0px;left:0px;color:#333;font-family:Arial;text-decoration:none;}
#tagscloud a:hover{color:#fff;padding:5px;display:block;background:#D02F53;}
#tagscloud a.tagc1{margin:0 10px 15px 0;line-height:18px;width:65px;text-align:center;font-size:12px;padding:1px 5px;white-space:nowrap;display:inline-block;border-radius:3px;background:#666;color:#fff;}
#tagscloud a.tagc2{margin:0 10px 15px 0;line-height:18px;width:60px;text-align:center;font-size:12px;padding:1px 5px;white-space:nowrap;display:inline-block;border-radius:3px;background:#F16E50;color:#fff;}
#tagscloud a.tagc5{margin:0 10px 15px 0;line-height:18px;width:70px;text-align:center;font-size:12px;padding:1px 5px;white-space:nowrap;display:inline-block;border-radius:3px;background:#006633;color:#fff;}
</style>
</head>
<body>
<center>
<div style="font-size:15px; font-weight:bold; text-align:center; line-height:25px;">超酷的js+css3實(shí)現(xiàn)的3D標(biāo)簽云特效
</center>
<div id="tagscloud">
<a href="#" class="tagc1" title="星級評分">星級評分(2)</a>
<a href="#" class="tagc2" title="層特效">層特效(34)</a>
<a href="#" class="tagc5" title="關(guān)鍵字">關(guān)鍵字(8)</a>
<a href="#" class="tagc2" title="拖拽">拖拽(5)</a>
<a href="#"" class="tagc2" title="分頁插件">分頁插件(6)</a>
<a href="#" class="tagc1" title="時間插件">時間插件(9)</a>
<a href="#" class="tagc2" title="彈出層">彈出層(60)</a>
<a href="#" class="tagc5" title="數(shù)據(jù)統(tǒng)計(jì)">數(shù)據(jù)統(tǒng)計(jì)(2)</a>
<a href="#" class="tagc2" title="HTML5">HTML5(12)</a>
<a href="#" class="tagc2" title="置頂特效">置頂特效(5)</a>
<a href="#" class="tagc5" title="選項(xiàng)卡">選項(xiàng)卡(23)</a>
<a href="#" class="tagc2" title="導(dǎo)航菜單">導(dǎo)航菜單(31)</a>
<a href="#" class="tagc1" title="原創(chuàng)作品">原創(chuàng)作品(3)</a>
<a href="#" class="tagc2" title="動畫插件">動畫插件(15)</a>
<a href="#" class="tagc5" title="實(shí)用特效">實(shí)用特效(47)</a>
<a href="#" class="tagc2" title="table插件">table插件(1)</a>
<a href="#" class="tagc2" title="文字特效">文字特效(20)</a>
<a href="#" class="tagc5" title="圖片特效">圖片特效(61)</a>
<a href="#" class="tagc1" title="在線客服">在線客服(4)</a>
<a href="#" class="tagc2" title="瀑布流">瀑布流(10)</a>
<a href="#" class="tagc5" title="網(wǎng)友蘑菇">網(wǎng)友蘑菇(0)</a>
<a href="#" class="tagc2" title="網(wǎng)友嘿嘿">網(wǎng)友嘿嘿(3)</a>
<a href="#" class="tagc2" title="前端工具">前端工具(4)</a>
<a href="#" class="tagc2" title="網(wǎng)友Adam">網(wǎng)友Adam(15)</a>
<a href="#" class="tagc1" title="三級聯(lián)動">三級聯(lián)動(21)</a>
<a href="#" class="tagc2" title="顏色插件">顏色插件(4)</a>
<a href="#" class="tagc5" title="向?qū)匦?>向?qū)匦?2)</a>
<a href="#" class="tagc2" title="自動補(bǔ)全">自動補(bǔ)全(5)</a>
<a href="#" class="tagc1" title="滾動特效">滾動特效(22)</a>
<a href="#" class="tagc5" title="提示插件">提示插件(24)</a>
</div></p> <p><script src='tagscloud.js' language='javascript'></script>
</body>
</html>

js代碼如下(tagscloud.js):

復(fù)制代碼
代碼如下:

var radius = 90;
var d = 200;
var dtr = Math.PI / 180;
var mcList = [];
var lasta = 1;
var lastb = 1;
var distr = true;
var tspeed = 11;
var size = 200;
var mouseX = 0;
var mouseY = 10;
var howElliptical = 1;
var aA = null;
var oDiv = null;
window.onload=function ()
{
var i=0;
var oTag=null;
oDiv=document.getElementById('tagscloud');
aA=oDiv.getElementsByTagName('a');
for(i=0;i<aA.length;i++)
{
oTag={};
aA[i].onmouseover = (function (obj) {
return function () {
obj.on = true;
this.style.zIndex = 9999;
this.style.color = '#fff';
this.style.background = '#0099ff';
this.style.padding = '5px 5px';
this.style.filter = "alpha(opacity=100)";
this.style.opacity = 1;
}
})(oTag)
aA[i].onmouseout = (function (obj) {
return function () {
obj.on = false;
this.style.zIndex = obj.zIndex;
this.style.color = '#fff';
this.style.background = '#9933FF';
this.style.padding = '5px';
this.style.filter = "alpha(opacity=" + 100 * obj.alpha + ")";
this.style.opacity = obj.alpha;
this.style.zIndex = obj.zIndex;
}
})(oTag)
oTag.offsetWidth = aA[i].offsetWidth;
oTag.offsetHeight = aA[i].offsetHeight;
mcList.push(oTag);
}
sineCosine( 0,0,0 );
positionAll();
(function () {
update();
setTimeout(arguments.callee, 40);
})();
};
function update()
{
var a, b, c = 0;
a = (Math.min(Math.max(-mouseY, -size), size) / radius) * tspeed;
b = (-Math.min(Math.max(-mouseX, -size), size) / radius) * tspeed;
lasta = a;
lastb = b;
if (Math.abs(a) <= 0.01 && Math.abs(b) <= 0.01) {
return;
}
sineCosine(a, b, c);
for (var i = 0; i < mcList.length; i++) {
if (mcList[i].on) {
continue;
}
var rx1 = mcList[i].cx;
var ry1 = mcList[i].cy * ca + mcList[i].cz * (-sa);
var rz1 = mcList[i].cy * sa + mcList[i].cz * ca;</p> <p>var rx2 = rx1 * cb + rz1 * sb;
var ry2 = ry1;
var rz2 = rx1 * (-sb) + rz1 * cb;</p> <p>var rx3 = rx2 * cc + ry2 * (-sc);
var ry3 = rx2 * sc + ry2 * cc;
var rz3 = rz2;</p> <p>mcList[i].cx = rx3;
mcList[i].cy = ry3;
mcList[i].cz = rz3;</p> <p>per = d / (d + rz3);</p> <p>mcList[i].x = (howElliptical * rx3 * per) - (howElliptical * 2);
mcList[i].y = ry3 * per;
mcList[i].scale = per;
var alpha = per;
alpha = (alpha - 0.6) * (10 / 6);
mcList[i].alpha = alpha * alpha * alpha - 0.2;
mcList[i].zIndex = Math.ceil(100 - Math.floor(mcList[i].cz));
}
doPosition();
}
function depthSort()
{
var i=0;
var aTmp=[];
for(i=0;i<aA.length;i++)
{
aTmp.push(aA[i]);
}
aTmp.sort
(
function (vItem1, vItem2)
{
if(vItem1.cz>vItem2.cz)
{
return -1;
}
else if(vItem1.cz<vItem2.cz)
{
return 1;
}
else
{
return 0;
}
}
);
for(i=0;i<aTmp.length;i++)
{
aTmp[i].style.zIndex=i;
}
}
function positionAll()
{
var phi = 0;
var theta = 0;
var max = mcList.length;
for (var i = 0; i < max; i++) {
if (distr) {
phi = Math.acos(-1 + (2 * (i + 1) - 1) / max);
theta = Math.sqrt(max * Math.PI) * phi;
} else {
phi = Math.random() * (Math.PI);
theta = Math.random() * (2 * Math.PI);
}
//坐標(biāo)變換
mcList[i].cx = radius * Math.cos(theta) * Math.sin(phi);
mcList[i].cy = radius * Math.sin(theta) * Math.sin(phi);
mcList[i].cz = radius * Math.cos(phi);</p> <p>aA[i].style.left = mcList[i].cx + oDiv.offsetWidth / 2 - mcList[i].offsetWidth / 2 + 'px';
aA[i].style.top = mcList[i].cy + oDiv.offsetHeight / 2 - mcList[i].offsetHeight / 2 + 'px';
}
}
function doPosition()
{
var l = oDiv.offsetWidth / 2;
var t = oDiv.offsetHeight / 2;
for (var i = 0; i < mcList.length; i++) {
if (mcList[i].on) {
continue;
}
var aAs = aA[i].style;
if (mcList[i].alpha > 0.1) {
if (aAs.display != '')
aAs.display = '';
} else {
if (aAs.display != 'none')
aAs.display = 'none';
continue;
}
aAs.left = mcList[i].cx + l - mcList[i].offsetWidth / 2 + 'px';
aAs.top = mcList[i].cy + t - mcList[i].offsetHeight / 2 + 'px';
//aAs.fontSize=Math.ceil(12*mcList[i].scale/2)+8+'px';
//aAs.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+100*mcList[i].alpha+")";
aAs.filter = "alpha(opacity=" + 100 * mcList[i].alpha + ")";
aAs.zIndex = mcList[i].zIndex;
aAs.opacity = mcList[i].alpha;
}
}
function sineCosine( a, b, c)
{
sa = Math.sin(a * dtr);
ca = Math.cos(a * dtr);
sb = Math.sin(b * dtr);
cb = Math.cos(b * dtr);
sc = Math.sin(c * dtr);
cc = Math.cos(c * dtr);
}

相關(guān)文章

最新評論