»
EnglishFrenchVietnamese

Print - Change color onMouseover - JavaScriptBank.com

Full version: jsB@nk » Link » Change color onMouseover
URL: https://www.javascriptbank.com/change-color-onmouseover-link.html

Change color onMouseover © JavaScriptBank.comThis JavaScript will change color of JavaScript link when visitors move mouse over it.

Full version: jsB@nk » Link » Change color onMouseover
URL: https://www.javascriptbank.com/change-color-onmouseover-link.html



CSS
<style type="text/css">.view_example{text-align: center;width: 100%;background-color: silver;border: 1px solid silver;}</style><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


JavaScript
<script language="JavaScript"><!--// By Jari Aarniala [[email protected]]if(navigator.appName == "Microsoft Internet Explorer" &&parseInt(navigator.appVersion) >= 4){        ie4 = true;}else {        ie4 = false;}function changeColor(){        if(ie4){                what = window.event.srcElement;                if(what.className == "link"){                        if(what.style.color == "green"){                                what.style.color = "lime";                        }                        else {                                what.style.color = "green";                        }                }                else {}        }}document.onmouseover = changeColor;document.onmouseout = changeColor;// --></script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<a href="http://www.yahoo.com/" style="color: green; text-decoration: none; font-family: Verdana,Arial; font-weight: 700;" class="link">Yahoo!</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.altavista.digital.com/" style="color: green; text-decoration: none; font-family: Verdana,Arial; font-weight: 700;" class="link">Altavista</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.lycos.com/" style="color: green; text-decoration: none; font-family: Verdana,Arial; font-weight: 700;" class="link">Lycos</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.infoseek.com/" style="color: green; text-decoration: none; font-family: Verdana,Arial; font-weight: 700;" class="link">Infoseek</a><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->