ok well ive used this javascript to select images and load them as a div tag background. <a href="javascript:changeImage(0);" class="border_black"><img src="images/card_example1_thumb.gif" style="border: 1px solid black;" alt="" /></a> <a href="javascript:changeImage(1);" class="border_black"><img src="images/card_example2_thumb.gif" style="border: 1px solid black;" alt="" /></a> is there a way i could do a conditional statement in JavaScript that will load a particular style sheet for each one depending which one was selected. for example load style sheet 1 if the first one is selected ?
sure. basically, this is to do with bringing in assets into the page dynamically. define a <link href="nohref" rel="stylesheet" type="text/css" id="condCSS" /> under changeImage, you can just apply: var csstoLoad = (num == 0) ? "/newCSS-1.css" : "/css2.css"; document.getElementById("condCSS").setAttribute("href", csstoLoad); PHP: i have not tested any of the above but i don't see a problem with it. under mootools i'd simply do: new Asset.css(csstoLoad); PHP: http://mootools.net/docs/Plugins/Assets#Assets:css