Posted: 12.01.2006 15:42 Post subject: Javascript onmouseover....... text glow
Napravio sam text glow effect u javascriptu ali ne shvačam kako se samo prikazuje na jednom textu i to na Test 1. Kako izvesti da se samo pokazuje na određenom kada je mouseover?
<script type="text/javascript">
var el;
var a = true;
var b = 127;
var time;
var time2;
function imediva(elId) {
if (document.getElementById) {el=document.getElementById(elId)}
if (document.all) {el=eval("document.all." + elId)}
if (el == undefined) return;
}
function startglow(elId)
{
if(a == true) {b+=4;}
if(b == 255) {b-=4; a = false;}
if(b==127) {b+=4; a = true;}
if(a == false) {b-=4;}
imediva(elId);
el.style.color="rgb("+ b +","+ b +"," + b + ")";
time = setTimeout ("startglow('" + elId + "')",16);
clearTimeout(time2);
}
function stopglow(elId) {
if (b > 127) {b-=4;}
imediva(elId);
el.style.color="rgb("+ b +","+ b +"," + b + ")";
time2 = setTimeout ("stopglow('" + elId + "')",16);
clearTimeout(time);
}
</script>
</head>
Pukneš ovu Javascript funkciju u header i dalje samo pazis kako dajes ime div tagu, tj. ID parametar. I to ime upises i u onmouseover funkciju(ime) i onmouseout funkciju(ime).
P.S.
Ovaj ti kod i nije neka sreca, prevelika, jer ako brzo bjezis s misem preko linkova, neki linkovi ostanu u nekoj svijetlijoj boji nego sto bi trebali jer se ne stignu restorat.
Trebalo bi jos malo doraditi funkciju.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum