I am actually doing a combo now of both CSS and javascript depending on the images I need but said i would post the javascript code for loading the images so here is an example:
Code:
<script type="text/javascript">
function show()
{
var images = ['header.jpg','left.gif','rup.jpg','rb.jpg'];
var head = document.getElementById("header");
headIndex = images[0];
head.src = headIndex;
var lBottom = document.getElementById("lb");
lbIndex = images[1];
lBottom.src = lbIndex;
var rUpper = document.getElementById("ru");
ruIndex = images[2];
rUpper.src = ruIndex;
var rBottom = document.getElementById("rb");
rbIndex = images[3];
rBottom.src = rbIndex;
}
</script>
And the html example to call it:
Code:
<body onload="show()">
<img id="header" src=""/>
<img id="lb" src=""/>
<img id="ru" src=""/>
<img id="rb" src=""/>
</body>
Now in the javascript I posted much earlier if you are using this depending on the users browser size you would essentially place identicle code in each part of your if/else depending on the size.
The picture going in the array would change for each if/else beauce you are looking to load the properly sized image exactly for that resolution but the IDS WOULD STAY THE SAME.
This allows for the html to load the proper image, and the proper one will be sent each time because the java will send the one that matches your resolution.
The html code for functionality doesnt actually need the src="" as that is set in the javascript but I have it in there beacuse it does not pass web standards without it being in there so just toss it in and forget it.
Hope this helps any other nut like me