Re: js: keep active div revealed when reloading page

by David Jones <dvjones(at)ksbe.edu>

 Date:  Thu, 9 Oct 2003 11:53:16 -1000
 To:  hwg-techniques(at)mail.hwg.org
 In-Reply-To:  tsoft
  todo: View Thread, Original
I like it, worked fine in Mozilla v1.4. A coworker 
checked it in Safari (where it didn't work) and Mac IE 
5.5.2, where it didn't work well at all.

FWIW, I saved the HTML off to a separate file and ran 
an HTML validator on it ... you might want to run it 
through the W3C validator, the one I use found 21 
errors in it, including nesting errors, a closing FONT tag 
that was never opened, etc. It also reported that there 
were too many errors so it was terminating the 
validation process.

Some of this could be because your HTML lacks a 
DOCTYPE declaration.

Fixing some of this might alleviate the problems on the 
Mac and in Netscape 7.

David
dvjones(at)ksbe.edu

On 9 Oct 2003, at 11:35, Collette McNeill wrote:

> 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

This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.