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>

figured it out myself... for anyone who needs it..

<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) 48% 63% no-repeat','url(http://i40.photobucket.com/albums/e250/jonsan32/ani4.gif)  43% 56% no-repeat','url(http://i40.photobucket.com/albums/e250/jonsan32/peoples_4461.gif) 14% 70% no-repeat','url(http://i40.photobucket.com/albums/e250/jonsan32/dancing17.gif) 41% 57% no-repeat','url(http://i40.photobucket.com/albums/e250/jonsan32/shskeletonz.gif) 45% 74% no-repeat','url(http://i40.photobucket.com/albums/e250/jonsan32/dancing22.gif) 55% 71% 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>
<style type="text/css">
/*Transparent Tables*/
table, tr, td {background:transparent; border:0px;}
table table table {background:transparent;}
table table table td {
background-color:transparent;
</style>
<table height="322" width=204>
<tr>     <td id="thisCell" valign="top"><center><img src="http://i40.photobucket.com/albums/e250/jonsan32/lunapic_128389578832483_2.gif"></td></center>   </tr>
</table>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.