right. Let me just write the whole thing for you
Here is some code
Code:
<script type="text/javascript">
function dynamicallyAddImage(src,height,width){
//Add <img>
//Variables
var varsrc = src;
var varheight = height;
var varwidth = width;
var temp_style = {"position":"relative", "width":varwidth+"px", "height":varheight +"px", "border":"0px"};
//Add images to page
//addImg(parent object, id, src, style)
temp_obj = addImg(document.getElementById("panelParent"), "img_id", varsrc , temp_style);
//add onclick to img
temp_obj.onclick = function(){callthisfunctiononclick()}
temp_obj = null;
}
</script>
For every image you want on the page add a line like this.
Code:
<img id="ImageButton02" src="Images/BRR02111.JPG" onclick="dynamicallyAddImage('image_src.png',60,30); dynamicallyAddImage('image_src2.png',70,20); dynamicallyAddImage('image_src3.png',50,40);">
When you click on the image it will add 3 new images to panelParent.
The images it adds have an onclick too, that when clicked on call a function named 'callthisfunctiononclick()'. You can change this to whatever function you like.
Bookmarks