// JavaScript Document jQuery(document).ready(function(){ var images = new Array() // ${initParam.siteRoot} images[0] = 'url(/content/images/Strip1.jpg) no-repeat' images[1] = 'url(/content/images/Strip2.jpg) no-repeat' images[2] = 'url(/content/images/Strip3.jpg) no-repeat' images[3] = 'url(/content/images/Strip4.jpg) no-repeat' images[4] = 'url(/content/images/strip5.jpg) no-repeat' images[5] = 'url(/content/images/Strip6.jpg) no-repeat' var p = images.length; var whichImage = Math.round(Math.random()*(p-1)); //jQuery("").appendTo("#banner") jQuery("#banner").css('background', images[whichImage]); //jQuery("#banner").css({backgroundColor: '#ffe', borderLeft: '5px solid #ccc'}) /*jQuery('.appear_link').bind('mouseout', function() { jQuery("#appear_link").fadeOut('700'); });*/ /*jQuery('#fillerElement').bind('mouseover', function() { jQuery("#cover").fadeOut('700'); });*/ //bind the mouseenter/mouseleave events to the sublinksContainer //and fadeIn and fadeOut the cover as necessary /*jQuery('#sublinksContainer').bind('mouseleave', function() { jQuery("#cover").fadeOut('700'); }); Loop over each . jQuery( "#sublinksContainer a" ).each( For each , run this code. The "intIndex" is the loop iteration index on the current element. function( intIndex ){ Bind the mouseenter/mouseleave events to simply alert the iteration index value. jQuery( this ).bind ( "mouseenter", function(){ jQuery("#appear_link" + (intIndex+1)).stop(true,true).fadeIn('700'); jQuery("#cover").stop(true,true).fadeIn('700'); } ); jQuery( this ).bind ( "mouseleave", function(){ jQuery("#appear_link" + (intIndex+1)).stop(true,true).hide(); jQuery("#cover").fadeOut('fast'); } ); } );*/ });