ambiemaber
10-11-2011, 03:02 AM
Hi There,
I have recently completed making a website for my sister's wedding. I am quite new to the web design world, and have only taken 2 classes on the subject. I used a Javascript function that was provided to us in one of my HTML coding classes in order to automatically resize the (nesting?) div's according to how long the content in them is.
This all seems to work perfectly fine in Google Chrome, as well as most versions of Internet Explorer - however, in some versions of internet explorer, and ALL versions of Firefox, this resize function does not seem to work. Since this coding was provided to me by a teacher (who is unfortunately in another country), I'm not sure what kinda of edit would make it so it would function in Firefox, or if there is a way to make in function in Firefox at all.
I would appreciate if some of you could take a look at it, and let me know if you have any ideas/suggestions/advice, as to what is happening with the code/why it does not work in Firefox/some versions of Internet Explorer.
The specific javascript code (which i assume is the issue here - please let me know if I'm wrong about it being the javascript that isn't working) is here:
function fnReset(){
document.getElementById('dTorso').style.height="380px";
document.getElementById('dMiddle').style.height="auto";
var middleHt=document.getElementById('dMiddle').scrollHeight;
var maxHt=Math.max(380,middleHt);
document.getElementById('dTorso').style.height=maxHt + "px";
document.getElementById('dMiddle').style.height=maxHt + "px";
}
Which is then called to action here:
<body onLoad="fnReset();>
Also, in some versions of Firefox, the background image for the whole page isn't showing up either - any tips on why that is happening would also be amazing.
Thank you so much for any help you may provide. This is a gift to my sister and her fiance, and I really want it to work well for them, and all their guests.
Thanks!
I have recently completed making a website for my sister's wedding. I am quite new to the web design world, and have only taken 2 classes on the subject. I used a Javascript function that was provided to us in one of my HTML coding classes in order to automatically resize the (nesting?) div's according to how long the content in them is.
This all seems to work perfectly fine in Google Chrome, as well as most versions of Internet Explorer - however, in some versions of internet explorer, and ALL versions of Firefox, this resize function does not seem to work. Since this coding was provided to me by a teacher (who is unfortunately in another country), I'm not sure what kinda of edit would make it so it would function in Firefox, or if there is a way to make in function in Firefox at all.
I would appreciate if some of you could take a look at it, and let me know if you have any ideas/suggestions/advice, as to what is happening with the code/why it does not work in Firefox/some versions of Internet Explorer.
The specific javascript code (which i assume is the issue here - please let me know if I'm wrong about it being the javascript that isn't working) is here:
function fnReset(){
document.getElementById('dTorso').style.height="380px";
document.getElementById('dMiddle').style.height="auto";
var middleHt=document.getElementById('dMiddle').scrollHeight;
var maxHt=Math.max(380,middleHt);
document.getElementById('dTorso').style.height=maxHt + "px";
document.getElementById('dMiddle').style.height=maxHt + "px";
}
Which is then called to action here:
<body onLoad="fnReset();>
Also, in some versions of Firefox, the background image for the whole page isn't showing up either - any tips on why that is happening would also be amazing.
Thank you so much for any help you may provide. This is a gift to my sister and her fiance, and I really want it to work well for them, and all their guests.
Thanks!