vForums Support Banner



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Database of Codes/Hacks/Mods :: Simple Image Rollover Code - View Topic
Topic Rating: *****
Printable View
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Simple Image Rollover Code (15th Mar 08 at 10:31pm UTC)
This will allow you to give any image a rollover. Even if it's a sig image! {Shocked}

Simply add more of:
roll_over('normal_image','rollover_image');
normal_image = the image to show normally
rollover_image = image to be shown when you mouseover the image.


Code:
Code:
 
  1. <script type="text/javascript">
  2. /*Rollover for buttons
  3. By Wrighty
  4. wRcreations & vFSupport*/
  5.  
  6. function roll_over(old, over){
  7.    var img = document.getElementsByTagName("img");
  8.    for(i=0; i<img.length; i++){
  9.       if(img[i].src.match(old)){
  10.          img[i].onmouseover = function(){this.src = over;};
  11.          img[i].onmouseout=function(){this.src = old;};
  12.       }
  13.    }
  14. }
  15.  
  16. roll_over('normal_image','rollover_image');
  17. </script>
 


Global Footer
 Printable View

All times are GMT+0 :: The current time is 3:29pm
Page generated in 0.0752 seconds
This Forum is Powered By vForums (v2.4)
Create a Forum for Free | Find Forums