بن غازي .: إدارة المنتدى :.
عدد الرسائل : 1822 العمر : 36 الدولة : المهنة : مزاجي : الاوسمهـ : السٌّمعَة : 0 نقاط : 378 تاريخ التسجيل : 16/08/2007
| موضوع: كود روابط قوس قزح المعدل الإثنين يناير 26, 2009 2:34 am | |
| <P> </P> <P> </P> <DIV align=center><FONT color=red><SPAN style="FONT-SIZE: 24px; LINE-HEIGHT: normal">هذا الكود يجعل الروابط تتغير الوانها بالوان طيف قوس القزح عند مرور الماوس عليها</SPAN></FONT><BR><BR><FONT color=green><SPAN style="FONT-SIZE: 24px; LINE-HEIGHT: normal"><BR><FONT color=green>تفضلو الكود</FONT><BR></SPAN></DIV> <P><BR><BR> - الكود:
-
<script language="Javascript1.2"><BR>var rate = 20; // Increase amount(The degree of the transmutation)<BR>////////////////////////////////////////////////////////////////////<BR>// Main routine<BR>if (document.getElementById)<BR>window.onerror=new Function("return true")<BR>var objActive; // The object which event occured in<BR>var act = 0; // Flag during the action<BR>var elmH = 0; // Hue<BR>var elmS = 128; // Saturation<BR>var elmV = 255; // Value<BR>var clrOrg; // A color before the change<BR>var TimerID; // Timer ID<BR>if (document.all) {<BR>document.onmouseover = doRainbowAnchor;<BR>document.onmouseout = stopRainbowAnchor;<BR>}<BR>else if (document.getElementById) {<BR>document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT);<BR>document.onmouseover = Mozilla_doRainbowAnchor;<BR>document.onmouseout = Mozilla_stopRainbowAnchor;<BR>}<BR>//=============================================================================<BR>// doRainbow<BR>// This function begins to change a color.<BR>//=============================================================================<BR>function doRainbow(obj)<BR>{<BR>if (act == 0) {<BR>act = 1;<BR>if (obj)<BR>objActive = obj;<BR>else<BR>objActive = event.srcElement;<BR>clrOrg = objActive.style.color;<BR>TimerID = setInterval("ChangeColor()",100);<BR>}<BR>}<BR>//=============================================================================<BR>// stopRainbow<BR>// This function stops to change a color.<BR>//=============================================================================<BR>function stopRainbow()<BR>{<BR>if (act) {<BR>objActive.style.color = clrOrg;<BR>clearInterval(TimerID);<BR>act = 0;<BR>}<BR>}<BR>//=============================================================================<BR>// doRainbowAnchor<BR>// This function begins to change a color. (of a anchor, automatically)<BR>//=============================================================================<BR>function doRainbowAnchor()<BR>{<BR>if (act == 0) {<BR>var obj = event.srcElement;<BR>while (obj.tagName != 'A' && obj.tagName != 'BODY') {<BR>obj = obj.parentElement;<BR>if (obj.tagName == 'A' || obj.tagName == 'BODY')<BR>break;<BR>}<BR>if (obj.tagName == 'A' && obj.href != '') {<BR>objActive = obj;<BR>act = 1;<BR>clrOrg = objActive.style.color;<BR>TimerID = setInterval("ChangeColor()",100);<BR>}<BR>}<BR>}<BR>//=============================================================================<BR>// stopRainbowAnchor<BR>// This function stops to change a color. (of a anchor, automatically)<BR>//=============================================================================<BR>function stopRainbowAnchor()<BR>{<BR>if (act) {<BR>if (objActive.tagName == 'A') {<BR>objActive.style.color = clrOrg;<BR>clearInterval(TimerID);<BR>act = 0;<BR>}<BR>}<BR>}<BR>//=============================================================================<BR>// Mozilla_doRainbowAnchor(for Netscape6 and Mozilla browser)<BR>// This function begins to change a color. (of a anchor, automatically)<BR>//=============================================================================<BR>function Mozilla_doRainbowAnchor(e)<BR>{<BR>if (act == 0) {<BR>obj = e.target;<BR>while (obj.nodeName != 'A' && obj.nodeName != 'BODY') {<BR>obj = obj.parentNode;<BR>if (obj.nodeName == 'A' || obj.nodeName == 'BODY')<BR>break;<BR>}<BR>if (obj.nodeName == 'A' && obj.href != '') {<BR>objActive = obj;<BR>act = 1;<BR>clrOrg = obj.style.color;<BR>TimerID = setInterval("ChangeColor()",100);<BR>}<BR>}<BR>}<BR>//=============================================================================<BR>// Mozilla_stopRainbowAnchor(for Netscape6 and Mozilla browser)<BR>// This function stops to change a color. (of a anchor, automatically)<BR>//=============================================================================<BR>function Mozilla_stopRainbowAnchor(e)<BR>{<BR>if (act) {<BR>if (objActive.nodeName == 'A') {<BR>objActive.style.color = clrOrg;<BR>clearInterval(TimerID);<BR>act = 0;<BR>}<BR>}<BR>}<BR>//=============================================================================<BR>// Change Color<BR>// This function changes a color actually.<BR>//=============================================================================<BR>function ChangeColor()<BR>{<BR>objActive.style.color = makeColor();<BR>}<BR>//=============================================================================<BR>// makeColor<BR>// This function makes rainbow colors.<BR>//=============================================================================<BR>function makeColor()<BR>{<BR>// Don't you think Color Gamut to look like Rainbow?<BR>// HSVtoRGB<BR>if (elmS == 0) {<BR>elmR = elmV; elmG = elmV; elmB = elmV;<BR>}<BR>else {<BR>t1 = elmV;<BR>t2 = (255 - elmS) * elmV / 255;<BR>t3 = elmH % 60;<BR>t3 = (t1 - t2) * t3 / 60;<BR>if (elmH < 60) {<BR>elmR = t1; elmB = t2; elmG = t2 + t3;<BR>}<BR>else if (elmH < 120) {<BR>elmG = t1; elmB = t2; elmR = t1 - t3;<BR>}<BR>else if (elmH < 180) {<BR>elmG = t1; elmR = t2; elmB = t2 + t3;<BR>}<BR>else if (elmH < 240) {<BR>elmB = t1; elmR = t2; elmG = t1 - t3;<BR>}<BR>else if (elmH < 300) {<BR>elmB = t1; elmG = t2; elmR = t2 + t3;<BR>}<BR>else if (elmH < 360) {<BR>elmR = t1; elmG = t2; elmB = t1 - t3;<BR>}<BR>else {<BR>elmR = 0; elmG = 0; elmB = 0;<BR>}<BR>}<BR>elmR = Math.floor(elmR).toString(16);<BR>elmG = Math.floor(elmG).toString(16);<BR>elmB = Math.floor(elmB).toString(16);<BR>if (elmR.length == 1) elmR = "0" + elmR;<BR>if (elmG.length == 1) elmG = "0" + elmG;<BR>if (elmB.length == 1) elmB = "0" + elmB;<BR>elmH = elmH + rate;<BR>if (elmH >= 360)<BR>elmH = 0;<BR>return '#' + elmR + elmG + elmB;<BR>}<BR></script><BR> </FONT></P> | |
|
حمساوي مشرف المنتدى الإسلامي
عدد الرسائل : 250 العمر : 31 المهنة : مزاجي : السٌّمعَة : 0 نقاط : 83 تاريخ التسجيل : 31/01/2008
| موضوع: رد: كود روابط قوس قزح المعدل الثلاثاء فبراير 10, 2009 12:39 am | |
| مشكووووووووووووووووووراخي على الموضوع الجميل يعطيك العافيه | |
|
ABDLI مشرف منتدى أخبـار السـاعة
عدد الرسائل : 2306 المهنة : السٌّمعَة : 0 نقاط : 63 تاريخ التسجيل : 20/08/2007
| موضوع: رد: كود روابط قوس قزح المعدل السبت فبراير 28, 2009 8:08 pm | |
| مساء الخيرات بعد الظهر وشكرا لكم | |
|