I think I'm almost done with a stupid gag present for my friend. I want his head on top of a random dancing image. My only problem is that I can't get the dancing images positioned correctly bcuz they're all different sizes. In an array, how would I add unique size properties without killing the entire effect. PS At least let me know if it looks funny. Thanks! :-)
<script type="text/javascript">
window.addEventListener?window.addEventListener('load',function()
{
ray.rand('thisCell');
},false):
window.attachEvent('onload',function()
{
ray.rand('thisCell');
}); // FF : IE1
var ray=
{
bgArr:['url(http://i40.photobucket.com/albums/e250/jonsan32/gifpalaced38.gif) bottom no-repeat','url(http://i40.photobucket.com/albums/e250/jonsan32/ani4.gif) bottom no-repeat','url(http://i40.photobucket.com/albums/e250/jonsan32/peoples_4461.gif) bottom no-repeat','url(http://i40.photobucket.com/albums/e250/jonsan32/agdance10.gif) bottom no-repeat','url(http://i40.photobucket.com/albums/e250/jonsan32/dancing17.gif) bottom no-repeat','url(http://i40.photobucket.com/albums/e250/jonsan32/shskeletonz.gif) bottom no-repeat','url(http://i40.photobucket.com/albums/e250/jonsan32/dancing22.gif) bottom no-repeat','url(http://i40.photobucket.com/albums/e250/jonsan32/lion-king-01-gif.gif) bottom no-repeat'], // Background you wish to show on the cell
rand:function(el)
{
var num = Math.floor(Math.random()*this.bgArr.length);
this.getID(el).style.background=this.bgArr[num];
},
getID:function(el){return document.getElementById(el);}
}
</script>
<table height="245" width=113>
<tr>
<td id="thisCell" valign="top"><img src="http://i40.photobucket.com/albums/e250/jonsan32/lunapic_128389578832483_2.gif"></td>
</tr>
</table>