js: keep active div revealed when reloading page
by Collette McNeill <collette(at)mlwebworks.com>
|
Date: |
Thu, 09 Oct 2003 11:35:18 -0700 |
To: |
hwg-techniques(at)mail.hwg.org |
|
todo: View
Thread,
Original
|
|
Hello,
My latest project is a page relying heavily on javascript.
http://205.158.168.102/009.shtml
The whole page and everything in it is designed to scale to the user's
browser window.
The background image is designed to resize if users resize their page.
All content is kept in divs which are revealed and hidden depending upon
user navigation.
The page is unfinished.
I have two problems which I hope this list can help me with:
1. The image doesn't seem to resize in NN7 on WinXP when a user resizes
their page.
2. When users resize their page, the <div> they were working in is hidden
and the introduction revealed.
// The command I use to accomplish the resize is (ignore dots please)
<.body onResize="history.go(0)">
// and the code to resize the page is below the body command:
<.!-- --------------------------- IMAGE RESIZE FUNCTION-->
<.div style="position:absolute;left:0;top:0;z-index:0;">
<.script langauge="javascript">
<.!--
//available height and width doesn't work if it's measured above body tag.
if(is.ns4||is.ns6) {
available_width=innerWidth;
available_height=innerHeight;
} else if(is.ie4||is.ie5||is.ieX) {
available_width=document.body.clientWidth;
available_height=document.body.clientHeight;
// alert("available height is " + available_height);
}
if(is.ie4 ||is.ie5||is.ieX||is.ns6|| is.ns4) {
image1_width = (available_width*1.00);
image1_height = (available_height*1.00);
var image1 = '<IMG SRC="picnic.jpg" WIDTH="' + image1_width + '" HEIGHT="'
+ image1_height + '">';
document.write(image1);
//alert("screen height:" + available_height);
}
//-->
<./script>
<!-------------------------------------------------------------------------------------------------------------->
-- Should I convert the routine to a function and call it when the page is
resized?
-- Is there a way I can reload the page, yet preserve the active div?
PLEASE help me if you can, I appreciate any help with these problems.
Thanks in advance!
Collette
HWG hwg-techniques mailing list archives,
maintained by Webmasters @ IWA