Indonesia
<HTML> <HEAD> <title>一种文字颜色渐变效果的超级连接特效</title> <script> <!-- //bentuk javascript lainnya http://www.downcodes.com document.onmouseover = domouseover; dokumen.onmouseout = domouseout; function domouseover() { if(document.all){ srcElement = window.event.srcElement; if (srcElement.className.indexOf("fade") > -1) { var linkName = srcElement.name; fadein(Namatautan); } } } fungsi domouseout() { if (dokumen.semua){ srcElement = window.event.srcElement; if (srcElement.className.indexOf("fade") > -1) { var linkName = srcElement.name; fadeout(namatautan); } } } fungsi makearray(n) { ini.panjang = n; untuk(var i = 1; saya <= n; i++) ini[i] = 0; kembalikan ini; } heksa = makearray baru(16); untuk(var i = 0; saya < 10; i++) hexa[i] = saya; heksa[10]="a"; heksa[11]="b"; heksa[12]="c"; heksa[13]="d"; heksa[14]="e"; heksa[15]="f"; fungsi hex(i) { jika (i < 0) mengembalikan "00"; else if (i > 255) kembalikan "ff"; lain kembalikan "" + hexa[Matematika.lantai(i/16)] + hexa[i%16];} function setbgColor(r, g, b, elemen) { var hr = hex(r); var hg = hex(g); var hb = heksa(b); elemen.gaya.warna = "#"+jam+hg+hb; } fungsi fade(sr, sg, sb, er, misal, eb, langkah, arah, elemen){ for(var i = 0; i <= langkah; i++) { setTimeout("setbgColor(Math.floor(" +sr+ " *(( " +langkah+ " - " +i+ " )/ " +langkah+ " ) + " +er+ " * (" +i+ "/" +langkah+ ")),Math.floor(" +sg+ " * (( " +langkah+ " - " +i+ " )/ " +langkah+ " ) + " +misalnya+ " * (" +i+ "/" +langkah+ ")),Matematika.floor(" +sb+ " * ((" +langkah+ " -" +i+ ")/" +langkah+ ") + " +eb+ " * (" +i+ "/" +langkah+ ")),"+elemen+");",i*langkah); } } fungsi fadeout(elemen) { fade(255,153,0, 0,0,0, 30, 1, elemen); } /*------------------=[memudar]=---------------------- || Memudarkan teks dari satu warna ke warna lain || ||ketika mouse bergerak melewati tautan. || ||------------------------------------------------ -*/ fungsi fadein(elemen) { fade(0,0,0, 255.153,0, 18, 1, elemen); } /*abaikan ini >>>>*/ function fadeIn2(id){ fade(255,255,255, 88,118,152, 25, 1, id); } fungsi fadeOut2(id){ fade(88,118,152, 255,255,255, 29, 1, id); } /*<<<<< berhenti mengabaikan =)*/ // --> </script> </HEAD> <BODY> <a href="#" class=fade name=a>建站学院</a> </body> </html> <!--说明:更改链接,要注意,每个链接的name不能相同,要一次顺延下去,比如name=a、name=b....... <a href="#" class=fade name=a>建站学院</a> 同时,我们再来研究一下颜色的修改,我们可以通过修改javascript代码。鼠标移fungsi fadeout(elemen) { fade( 255.153,0, 0,0,0, 30, 1, elemen); } 其中,255,153,0为起始色;0,0,0为终止色;30为渐变步长;颜色都为RGB。 同理,鼠标移入时的渐变Contohnya: function fadein(elemen) { fade(0 ,0,0, 255.153,0, 18, 1, elemen); } 只要更改这些颜色的RGB,和渐变步长,就能更改效果了!-->