vForums Support > Programming & Coding :: Code Requests & Support :: > [F] rollover menu

[F] rollover menu - Posted By Alex Bailey (system) on 2nd Mar 08 at 12:15pm
Well i had a rollover menu on PB that didn't require any images in the code and i wondered if i could have one please.
{Smile}

Re: rollover menu - Posted By Michael (wrighty) on 2nd Mar 08 at 12:26pm
Code:
 
  1. <script type="text/javascript">
  2. /*Rollover for buttons
  3. By Wrighty
  4. wRcreations & vFSupport*/
  5.  
  6.  
  7. for(i=0;i<get('img','tag').length;i++){
  8. if(get('img','tag')[i].src.match(/_off.(gif|png|jpg)/)){
  9. get('img','tag')[i].onmouseover = function(){this.src = this.src.replace(/_off/,'_on');};
  10. get('img','tag')[i].onmouseout=function(){this.src = this.src.replace(/_on/,'_off');};
  11. }
  12. }
  13.  
  14. </script>
 


should work! {Tongue Out}

I modified one I had lying around.

name them x_off and x_on {Smile}

.gif, .jpg and .png supported! {Smile}

Re: rollover menu - Posted By Alex Bailey (system) on 2nd Mar 08 at 1:00pm
Yeah works thanks {Smile}