PDA

View Full Version : Frames, Javascript help


adamsolove
05-13-1999, 11:32 PM
First I will explain what I want to do, then how i think I can do it:
I want to creat a nav system that takes little space, but shows a lot. I have previously devided my site into categorees. I want to display the catagory names in a frame at the top. Then when the mouse goes over a category, the picture swaps with one displaying actual links to pages in that category (I can do everthing to this point with JS) However, to save space, I would like to make the frame originaly just small enough to display the category names. However, when the new image comes up, I would like it to make the frame big enough to view the entire new picture.
------------------
Adam Solove
mailto:adamsolove@xoommail.com
Da Man

meikel
05-14-1999, 03:27 AM
Hi,

I must admit that I'm in no way convinced that your script idea is a good idea. I don't like frames anyway, and thinking about frame that flips around and grows and shrinks makes me shudder :)

I checked through my doc and found the resizeTo method


resizeTo
Resizes an entire window to the specified pixel dimensions.
Method of
[nbsp]Window
[nbsp]
Implemented in
[nbsp]Navigator 4.0

Syntax
resizeTo(outerWidth, outerHeight)

Parameters
outerWidth
[nbsp]An integer representing the window's width in pixels.
[nbsp]
outerHeight
[nbsp]An integer representing the window's height in pixels.
[nbsp]
Description
This method changes the window's dimensions by setting its outerWidth and outerHeight properties. The upper left-hand corner remains anchored and the lower right-hand corner moves. resizeBy moves to the specified position. The origin of the axes is at absolute position (0,0); this is the upper left-hand corner of the display.

Security
Exceeding any of the boundaries of the screen (to hide some or all of a window) requires signed JavaScript, so a window won't move past the screen boundaries. In addition, windows have an enforced minimum size of 100 x 100 pixels; resizing a window to be smaller than this minimum requires signed JavaScript. You need the UniversalBrowserWrite privilege for this. For information on security in Navigator 4.0, see Chapter 7, "JavaScript Security," in the JavaScript Guide.

Examples
To make the window 225 pixels wide and 200 pixels tall, use this statement:

self.resizeTo(225,200); // absolute positioning
See also
Window.resizeBy


The main problem with it is that it's implemented in Navigator 4. So any netscape before 4 will give you javascript errors. I don't know about IE. Maybe MS doesn't like this routine at all.

Have you thought on making a real menu-script?
If you go through typical Javascript sites, you find some samples on how to do this. The final resoult could look a bit like the menu(s) on microsoft site.

I once tried to do this on my own site but then decided against it, because my web statistics revealed too many old browsers. I don't want a funky site, I just want that everybody can download my shareware.

Greetings from Bonn, Germany
[nbsp][nbsp]Meikel Weber
www.meikel.com (http://www.meikel.com)

adamsolove
05-14-1999, 12:31 PM
Hmm, I'm not sure. This method resizes a frame? I think it would be good. Because in frame, always visible. And once I implement the resize capability, it won't take up much space.
As far as other menu types, the main problem, is this: the menu isn't a simple onmouseover that swaps an image, it has to change a seperate image, then leave it there so it's clickable, instead of changing it back again when the mouse leaves. Can you understand what I'm saying?
If anyone has a good nav script that allows for good customization (a.k.a. Microsoft) I would be appreciative.[nbsp][nbsp]

adamsolove
05-14-1999, 12:37 PM
Hmm, I'm not sure. This method resizes a frame? I think it would be good. Because in frame, always visible. And once I implement the resize capability, it won't take up much space.
As far as other menu types, the main problem, is this: the menu isn't a simple onmouseover that swaps an image, it has to change a seperate image, then leave it there so it's clickable, instead of changing it back again when the mouse leaves. Can you understand what I'm saying?
If anyone has a good nav script that allows for good customization (a.k.a. Microsoft) I would be appreciative.[nbsp][nbsp]