|
Post by votan on Sept 16, 2008 8:45:03 GMT -5
Can anyome help me to get the domroll image roll over effect to work? I must be missing something in the RB code!? (what should happen is, that when you move the mouse over the savebutton image it should instantly change into the openbutton image. Code works just fine in normal html.... This is the RB test-code:html "<script src='/domroll.js'></script>" html "<img src='/savebutton.png' class='domroll /openbutton.png' />" and this is the JS class.... needs to be stored as a seperate file named "domroll.js" in the rbp/public/ folder:function domRollover() { if (navigator.userAgent.match(/Opera (\S+)/)) { var operaVersion = parseInt(navigator.userAgent.match(/Opera (\S+)/)[1]); } if (!document.getElementById||operaVersion <7) return; var imgarr=document.getElementsByTagName('img'); var imgPreload=new Array(); var imgSrc=new Array(); var imgClass=new Array(); for (i=0;i<imgarr.length;i++){ if (imgarr[i].className.indexOf('domroll')!=-1){ imgSrc[i]=imgarr[i].getAttribute('src'); imgClass[i]=imgarr[i].className; imgPreload[i]=new Image(); if (imgClass[i].match(/domroll (\S+)/)) { imgPreload[i].src = imgClass[i].match(/domroll (\S+)/)[1] } imgarr[i].setAttribute('xsrc', imgSrc[i]); imgarr[i].onmouseover=function(){ this.setAttribute('src',this.className.match(/domroll (\S+)/)[1]) } imgarr[i].onmouseout=function(){ this.setAttribute('src',this.getAttribute('xsrc')) } } } } domRollover();
|
|
|
Post by votan on Sept 18, 2008 4:27:40 GMT -5
Ok, found out myself.... This line html "<script src='/domroll.js'></script>" goes to the very end of all the html code.
|
|