R
Ron Crump
Hi,
I have a small javascript (scalegr.js) that re-scales a sequence of
images on a page to be less than the frame width, thus:
function scalegr(a) {
var imgs = document.images;
var fw = window.innerWidth;
for (var i=0; i<imgs.length; i++) {
var w=imgs.width;
imgs.width = a*fw
}
}
Which is called from an HTML page as follows:
<HTML>
<HEAD>
<TITLE> Test Image Scaling</TITLE>
<script type='text/javascript' src='scalegr.js'></script>
</HEAD>
<body onload="javascript:{if(parent.frames[0]&&parent.frames['navbar'].Go)parent.frames['navbar'].Go();scalegr(0.85)}"
onresize="javascript:{scalegr(0.85)}">
<H1>Image</H1>
<IMG SRC="trend1.gif" BORDER="0">
</BODY>
</HTML>
This works fine in Netscape/Mozilla but in IE, the images appear to
load (ie they are visible until loading completes) then they
disappear.
Any suggestions gratefully received, fixes to the above or a general
way of scaling my simple images to account for people with different
resolutions and/or not maximised browser displays.
Could you copy replies to my e-mail too, please (rcrump at une dot edu
dot au).
TIA.
Ron Crump
I have a small javascript (scalegr.js) that re-scales a sequence of
images on a page to be less than the frame width, thus:
function scalegr(a) {
var imgs = document.images;
var fw = window.innerWidth;
for (var i=0; i<imgs.length; i++) {
var w=imgs.width;
imgs.width = a*fw
}
}
Which is called from an HTML page as follows:
<HTML>
<HEAD>
<TITLE> Test Image Scaling</TITLE>
<script type='text/javascript' src='scalegr.js'></script>
</HEAD>
<body onload="javascript:{if(parent.frames[0]&&parent.frames['navbar'].Go)parent.frames['navbar'].Go();scalegr(0.85)}"
onresize="javascript:{scalegr(0.85)}">
<H1>Image</H1>
<IMG SRC="trend1.gif" BORDER="0">
</BODY>
</HTML>
This works fine in Netscape/Mozilla but in IE, the images appear to
load (ie they are visible until loading completes) then they
disappear.
Any suggestions gratefully received, fixes to the above or a general
way of scaling my simple images to account for people with different
resolutions and/or not maximised browser displays.
Could you copy replies to my e-mail too, please (rcrump at une dot edu
dot au).
TIA.
Ron Crump