<!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 name="keywords" content="站长,网页特效,网页特效代码,js特效,js脚本,脚本,广告代码,zzjs,zzjs.net,www.zzjs.net,站长特效 网" /> <meta name="description" content="www.zzjs.net,站长特效网,站长必备js特效及广告代码。大量高质量js特效,提供高质量广告代码下载,尽在站长特效网" /> <title>网页特效 仿开心网好友印象 站长特效网欢迎您。</title> <style type="text/css"> .www_zzjs_net { width: 500px; padding: 10px; height: auto; overflow: hidden; text-align: center; font-family: tahoma,arial,simsun; } .www_zzjs_net span { height: 30px; white-space: nowrap; display: inline-block; cursor: pointer; } .www_zzjs_net a, .www_zzjs_net a:hover { padding: 8px; border: 2px #09e solid; color: #fff; line-height: 16px; font-weight: bold; font-size: 14px; text-decoration: none; position: relative; } input.cur { border: 1px #c00 outset; } </style> </head> <body> <a href="http://www.zzjs.net/">站长特效网</a>,站长必备的高质量网页特效和广告代码。zzjs.net,站长js特效。<hr> <div class="www_zzjs_net"> <span><a href="#">色鬼</a></span><span><a href="#">晒个</a></span><span><a href="#">不知道</a></span><span><a href="#">打黑工</a></span><span><a href="#">您懂个啥</a></span><span><a href="#">-……-</a></span><span><a href="#">休息</a></span><span><a href="#">帅气</a></span><span><a href="#">天涯地方</a></span><span><a href="#">修复</a></span><span><a href="#">暗恋</a></span><span><a href="#">打工的人</a></span><span><a href="#">地方官</a></span><span><a href="#">速度</a></span><span><a href="#">地方</a></span><span><a href="#">交互</a></span><span><a href="#">少吃点</a></span><span><a href="#">南工大</a></span><span><a href="#">对方</a></span><span><a href="#">期望</a></span><span><a href="#">闪电狗</a></span><span><a href="#">打黑工</a></span><span><a href="#">您懂个啥</a></span><span><a href="#">-……-</a></span><span><a href="#">休息</a></span><span><a href="#">帅气</a></span><span><a href="#">天涯地方</a></span><span><a href="#">修复</a></span><span><a href="#">暗恋</a></span><span><a href="#">打工的人</a></span><span><a href="#">地方官</a></span><span><a href="#">速度</a></span><span><a href="#">地方</a></span></div> <br /> <br /> <input type="text" value="站长特效评价" maxlength="4" id="input-txt" /> <input type="button" value="评价" id="input-btn" /> <input type="button" value="Clear" onclick="n = false" /> <script type="text/javascript"> var n = false; function isNum(temp) { var n, re = /^\d+$/; if (!re.test(temp)) { return true; } return false; } function isChinese(temp) { var m, re = /[^\u4e00-\u9fa5]/; var temps = temp.split(""); for (var i = 0; i < temp.split("").length; i++) { if (!re.test(temp.split("")[i])) { m = true; break; } } if (m) return true; return false; } function randomColor() { var arrHex = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"]; var strHex = "#"; var index; for (var i = 0; i < 6; i++) { index = Math.round(Math.random() * 15); strHex += arrHex[index]; } return strHex; } function changeColor() { var links = document.getElementsByTagName("a"); for (var i = 0; i < links.length; i++) { var bgColor = randomColor(); links[i].style.backgroundColor = links[i].style.borderColor = bgColor; } } function sayHi() { var scolor, links = document.getElementsByTagName("a"); for (var i = 0; i < links.length; i++) { links[i].onmouseover = function () { scolor = this.style.backgroundColor; this.style.color = scolor; this.style.borderColor = scolor; this.style.backgroundColor = "white"; } links[i].onmouseout = function () { this.style.color = "white"; this.style.backgroundColor = this.style.borderColor = scolor; } links[i].onmousedown = function () { //if(n){ // alert("您已经评价过了"); // return false; //} alert('您对sky的印象是 "' + this.childNodes[0].nodeValue + '"'); n = true; } } } function addEvaluation() { var txt = document.getElementById("input-txt"); var btn = document.getElementById("input-btn"); var divs = document.getElementsByTagName("div")[0]; if (!txt) return false; if (!btn) return false; var texts, links, spans; txt.onfocus = function () { btn.className = "cur"; } txt.onblur = function () { btn.className = ""; } btn.onclick = function () { if (n) { alert("您已经评价过了"); return false; } if (txt.value == "") { alert("请输入一个印象词"); return false; } if (txt.value !== "2") { if (!isNum(txt.value)) { alert("请输入一个印象词"); return false; } } texts = document.createTextNode(txt.value); links = document.createElement("a"); spans = document.createElement("span"); links.appendChild(texts); links.style.backgroundColor = links.style.borderColor = randomColor(); spans.appendChild(links); divs.appendChild(spans); sayHi(); n = true; } } changeColor(); sayHi(); addEvaluation(); </script> </body> </html>