1) Script Title: DHTML Window widget (v1.1)
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/
3) Describe problem:
I'm wanting to have an Image auto resize according to the size of the popup ajax widget, ie if a person resizes the window the image adjusts accordingly
I have tried
Code:<script type="text/javascript"> function resizeImage() { var window_height = document.body.clientHeight var window_width = document.body.clientWidth var image_width = document.images[0].width var image_height = document.images[0].height var height_ratio = image_height / window_height var width_ratio = image_width / window_width if (height_ratio > width_ratio) { document.images[0].style.width = "auto" document.images[0].style.height = "100%" } else { document.images[0].style.width = "100%" document.images[0].style.height = "auto" } } </script> <body onresize="resizeImage()"> <center><img onload="resizeImage()" margin="0" border="0" src="MyImage.jpg"></center> </body>
Any ideas if this is possible ?



Reply With Quote
Bookmarks