»
EnglishFrenchVietnamese

Print - Highlight image onMouseover - JavaScriptBank.com

Full version: jsB@nk » Image » Highlight image onMouseover
URL: https://www.javascriptbank.com/highlight-image-onmouseover.html

Highlight image onMouseover © JavaScriptBank.comA script that makes any image(s) appear dull before the mouse moves over it; as the mouse moves over it, the image changes to its original appearance. This is a script controlled effect, so no altering is required to the actual image in any way.

Full version: jsB@nk » Image » Highlight image onMouseover
URL: https://www.javascriptbank.com/highlight-image-onmouseover.html



JavaScript
<SCRIPT language=javascript>document.onmouseover = domouseover;document.onmouseout = domouseout;function domouseover() {  if(document.all){  srcElement = window.event.srcElement;  if (srcElement.className.indexOf("fade") > -1) {        var linkName = srcElement.name;      fadein(linkName);      }      }}function domouseout() {  if (document.all){  srcElement = window.event.srcElement;  if (srcElement.className.indexOf("fade") > -1) {        var linkName = srcElement.name;      fadeout(linkName);      }      }}function makearray(n) {    this.length = n;    for(var i = 1; i <= n; i++)        this[i] = 0;    return this;}hexa = new makearray(16);for(var i = 0; i < 10; i++)    hexa[i] = i;hexa[10]="a"; hexa[11]="b"; hexa[12]="c";hexa[13]="d"; hexa[14]="e"; hexa[15]="f";function hex(i) {    if (i < 0)        return "00";    else if (i > 255)        return "ff";    else       return "" + hexa[Math.floor(i/16)] + hexa[i%16];}function setbgColor(r, g, b, element) {      var hr = hex(r); var hg = hex(g); var hb = hex(b);      element.style.color = "#"+hr+hg+hb;}function fade(sr, sg, sb, er, eg, eb, step, direction, element){    for(var i = 0; i <= step; i++) {setTimeout("setbgColor(Math.floor(" +sr+ " *(( " +step+ " - " +i+ " )/ " +step+ " ) + " +er+ " * (" +i+ "/" +step+ ")),Math.floor(" +sg+ " * (( " +step+ " - " +i+ " )/ " +step+ " ) + " +eg+ " * (" +i+ "/" +step+ ")),Math.floor(" +sb+ " * ((" +step+ "-" +i+ ")/" +step+ ") + " +eb+ " * (" +i+ "/" +step+ ")),"+element+");",i*step);    }}function fadeout(element) {              fade(255,255,204, 204,204,204, 30, 1, element);}function fadein(element) {     fade(204,204,204, 255,255,204, 15, 1, element);}/*ignore this >>>>*/function fadeIn2(id){fade(255,255,204, 209,213,237, 25, 1, id);}function fadeOut2(id){fade(88,118,152, 255,255,204, 29, 1, id);}/*<<<<< stop ignoring =)*/</SCRIPT><SCRIPT language=JavaScript type=""><!--function high(which2){theobject=which2highlighting=setInterval("highlightit(theobject)",50)}function low(which2){clearInterval(highlighting)which2.filters.alpha.opacity=70}function highlightit(cur2){if(cur2.filters.alpha.opacity<100)cur2.filters.alpha.opacity+=10else if(window.highlighting)clearInterval(highlighting)}//--></SCRIPT><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<IMG onmouseover=high(this) style="FILTER: alpha(opacity=70)" onmouseout=low(this) src="logojs.gif" border=0><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->