모

질문드리기 머하네요;

· 2009-01-03 (토) 01:41:09 · 897
오류가 나는곳의 주소를 알려주시면 더 빠르고 정확하게 답변 받을 수 있습니다.

아래 소스를 이용해서 태그구름을 어떻게 형성하면 될까요;;너무 어렵네요.ㅠㅠ
한번 올려주시요;부탁드려요;너무 멋져서;



<HTML>
<HEAD>
<TITLE>BLUE-B</TITLE>


<style type="text/css">
.over {background:#ccc;color:#000;cursor:pointer}
.out {background:transparent;color:#000;}
.tagsoup {color:#000;font-family:verdana;text-align:left;border:#888 dashed 1px;background:#fff}
</style>

<script type="text/javascript">
<!--

document.onselectstart = new Function("return false");
document.onmousedown = new Function("return false");

T = "javascript web reference software development design css programming dhtml html firefox webdev dom tools blog flash fonts computer tech windows computing hacking java algorithms processing language environment program images animation sound development php apache regexp tips news journal code computers virus security scripts parsing win32 bytecode DOM interactive Menu organization webdesign ajax xmlhttprequest technology comprehension language software xhtml rss xml wiki optimization delicious demo dragdrop browsers standards code lifehacks tutorial howto".split(" ");

var object = new Array();
var z = false;

function pos(o, fs, s){
o.style.fontSize = fs;
o.style.zIndex = 10000 - fs;
l = parseInt(o.style.left);
l += s * (o.innerHTML.length * o.innerHTML.length) * fs / 400;
o.style.left = l;
t = parseInt(o.style.top);
t += s * fs / 15;
o.style.top = t;
}

function zoom(k){
O = object[k];
fs = Math.round(parseInt(O.style.fontSize) * 1.1 + 1);
if(fs < 1200 && z){
pos(O, fs, -1);
o = "";
s = 0;
for(i in object){
if(object[i] != O){
if(parseInt(object[i].style.fontSize) > s){
s = parseInt(object[i].style.fontSize);
o = object[i];
}
}
}
fs = Math.round(parseInt(o.style.fontSize) * .9 - 1);
pos(o, fs, 1);
setTimeout("zoom("+k+");", 32);
}
}


function word(i, w){
object[i] = obj = document.createElement("span");
obj.style.position = "absolute";
obj.style.left = Math.random()*600;
obj.style.top = Math.random()*400;
fs = w.length>2 && Math.random()>.666?Math.round(10 + Math.random() * 40):10;
obj.style.fontSize = fs + "px";
obj.style.zIndex = 10000 - fs;
obj.innerHTML = w;
obj.onmousedown = new Function("z = true;zoom(" + i + ");return true;");
obj.onmouseup = new Function("z = false;return true;");
obj.onmouseover = new Function("this.className = 'over'");
obj.onmouseout = new Function("this.className = 'out'");
document.getElementById("tagsoup").appendChild(obj);
}

onload = function() {
for(i in T)word(i, T[i]);
}

//-->
</script>
</head>

<body>

<div style="position:realtive;height:400">
<div id="tagsoup" class="tagsoup" style="position:absolute;width:600;height:400;overflow:hidden;">
</div>
</div>


</body>
</html>
댓글을 작성하시려면 로그인이 필요합니다.

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
09-01-03 조회 1,035
09-01-03 조회 949
09-01-03 조회 1,026
09-01-03 조회 1,650
09-01-03 조회 909
09-01-03 조회 1,634
09-01-03 조회 2,799
09-01-03 조회 1,050
09-01-03 조회 865
09-01-03 조회 864
09-01-03 조회 1,176
09-01-03 조회 1,041
09-01-03 조회 1,050
09-01-03 조회 898
09-01-03 조회 1,581
09-01-03 조회 969
09-01-03 조회 984
09-01-03 조회 1,031
09-01-02 조회 1,684
09-01-02 조회 1,637