Hi,
I have no clue yet how you are going to programmatically resize your div... , but the way to go is to use separate css classes.
Your html could look like this:
Code:
<div class="Size1" id="mydiv" >
<img class="topleft" alt="bird" src="bird-s.png" >
<img class="topright" alt="king" src="king-s.png" >
<img class="bottomleft" alt="phone" src="phone-s.png" >
<img class="bottomright" alt="india" src="india-s.png" >
</div>
Your css could look like this:
Code:
Size1 {
border: solid 1px red;
width: 960px;
height: 540px;
}
.Size1 img {
border: solid 1px red
}
.Size1 img.topleft {
left: -62px;
top: 85px;
z-index: 11;
position: absolute;
}
.Size1 img.topright {
left: 356px;
top: 432px;
z-index: 12;
position: absolute;
}
.Size1 img.bottomleft {
left: 866px;
top: 196px;
z-index: 13;
position: absolute;
}
.Size1 img.bottomright {
left: 420px;
top: -54px;
z-index: 14;
position: absolute;
}
.Size2 {
border: solid 1px green;
width: 960px;
height: 540px;
}
.Size2 img.topleft {
left: 0px;
top: 10px;
z-index: 11;
position: absolute;
}
.Size2 img.topright {
left: 500px;
top: 10px;
z-index: 12;
position: absolute;
}
.Size2 img.bottomleft {
left: 0px;
top: 500px;
z-index: 13;
position: absolute;
}
.Size2 img.bottomright {
left: 500px;
top: 500px;
z-index: 14;
position: absolute;
}
And your javascript could look like this:
Code:
function ResizeThem(){
if (document.getElementById("mydiv").className == "Size1")
document.getElementById("mydiv").className = "Size2";
else
document.getElementById("mydiv").className = "Size1";
}
I hope this helps, success !