vForums Support Banner



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Database of Codes/Hacks/Mods :: Adv. Image Rollover - 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
Adv. Image Rollover (15th Mar 08 at 10:26pm UTC)
This will allow you to add a rollover to ANY images. To get this to work, you have to name your images:

x_on and x_off. This is because the code will automatically change the '_on' to '_off' and vice-versa.

<script type="text/javascript">
/*Rollover for buttons
By Wrighty
wRcreations & vFSupport*/


for(i=0;i<get('img','tag').length;i++){
    if(get('img','tag')[i].src.match(/_off.(gif|png|jpg)/)){
        get('img','tag')[i].onmouseover = function(){this.src = this.src.replace(/_off/,'_on');};
        get('img','tag')[i].onmouseout=function(){this.src = this.src.replace(/_on/,'_off');};
    }
}
</script>


Global Footer
 Printable View

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