Forgotten your password?

Forum Index > JavaScript > PreCaching Images
Author Message
ok this is example of precaching images easily for use with buttons etc like mouse over


first in your <head> add the js script

1
2
3
4
5
6
7
8
<script language="Javascript">
{
  image1 = new Image
  image2 = new Image
  image1.src = '/images/image1.gif'
  image2.src = '/images/image2.gif'
}
</script>


then on the td of the menu...

1
<td onMouseOver="this.background=image2.src" onMouseOut="this.background=image1.src">


baring in mind it needs also an original background like

1
<td background="this.background=image1.src" etc etc>


; M E K A ;
Forum Index > JavaScript > PreCaching Images