fix javascript error in ie

git-svn-id: file:///home/shish/svn/shimmie2/trunk@819 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
shish 2008-04-14 11:21:05 +00:00
parent 7edf906065
commit d4bc3ace03

View File

@ -12,6 +12,7 @@ class ZoomTheme extends Themelet {
<script type="text/javascript"> <script type="text/javascript">
img = document.getElementById("main_image"); img = document.getElementById("main_image");
if(img) {
img.onclick = function() {scale(img);}; img.onclick = function() {scale(img);};
msg_div = document.createElement("div"); msg_div = document.createElement("div");
@ -22,6 +23,9 @@ img.parentNode.insertBefore(msg_div, img);
orig_width = $image_width; orig_width = $image_width;
$default
}
function scale(img) { function scale(img) {
if(orig_width >= img.parentNode.clientWidth * 0.9) { if(orig_width >= img.parentNode.clientWidth * 0.9) {
if(img.style.width != "90%") { if(img.style.width != "90%") {
@ -34,8 +38,6 @@ function scale(img) {
} }
} }
} }
$default
</script> </script>
EOD; EOD;
} }