效果图:
示例代码:
<!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=utf-8" />
<title>js标签云</title>
<style type="text/css">
<!--
*{margin:0;padding:0; border:none;}
body{background-color:#000;}
#div1 {position:relative; width:450px; height:450px; padding:20px;margin:40px auto 0; background:#666; overflow:hidden;}
#div1 a {position:absolute; top:0px; left:0px;display:block; font-family:"Arial"; color:#fff; text-decoration:none; text-align:center;width:200px; height:30px; overflow:hidden; }
-->
</style>
<script type="text/javascript">
var radius = 150;
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=200;
var mouseX=0;
var mouseY=0;
var howElliptical=1;
var aA=null;
var oDiv=null;
window.οnlοad=function ()
{
var i=0;
var oTag=null;
oDiv=document.getElementById('div1');
aA=oDiv.getElementsByTagName('a');
for(i=0;i<aA.length;i++)
{
oTag={};
oTag.offsetWidth=aA[i].offsetWidth;