link hover pelangi pada blog


1. Login ke dashboard blogger.
2. Pilih Rancangan > Elemen Laman > Add gadget (HTML/JavaScript).
3. Copy kode javascript dibawah ini dan paste pada gadget
<script language=javascript>
var timerID,
srcElemActive,
count = 0,
oldColor;
var clrArray = new Array(
'D0CBFE', '8C80FD', '5543FC', '1B04E3', // blue
'E7FFE6', 'B7FFB3', '80FF79', '0AC400', // green
'FFD6D5', 'FF9693', 'FF3D37', 'EA0600' // red
);
var ie = navigator.appName=='Microsoft Internet Explorer'?true:false,
op = window.opera?true:false,
ns = navigator.vendor?true:false;
function ChangeColor(){if(srcElemActive) srcElemActive.style.color = '#'+clrArray[count++]; if(count == (clrArray.length - 1)) count = 0}
///////////////////////////////////////////////////////////////////////////////
// makeRainbow function
///////////////////////////////////////////////////////////////////////////////
function makeRainbow(evt){if(op) return; var srcElem = getObject(evt); var temp = ""; if(srcElem.tagName == "A"&&srcElem.href != ''){srcElemActive = srcElem; oldColor = srcElem.style.color; timerID = setInterval("ChangeColor()",200)}
return true}
///////////////////////////////////////////////////////////////////////////////
// stopRainbow function
///////////////////////////////////////////////////////////////////////////////
function stopRainbow(evt){var srcElem = getObject(evt); if(op &&srcElem.className != 'rate_item') return; if(srcElemActive &&srcElem.tagName == "A"&&srcElem.href != ''){srcElemActive = null; srcElem.style.color = oldColor; clearInterval(timerID)}
}
///////////////////////////////////////////////////////////////////////////////
// getObject function
///////////////////////////////////////////////////////////////////////////////
function getObject(evt){var srcElem; if(ie){srcElem = event.srcElement}
else{srcElem = evt.target}
return srcElem}
document.onmouseover = makeRainbow;
document.onmouseout = stopRainbow;
</script>
4. Save
 
Top