PDA

View Full Version : addressing frames with complex hierarchy


lesliej
05-25-2003, 07:05 PM
Attached is a diagram of all the nested frames and framesets for a website. As you can see, there are numerous children, grand-children and cousins.
There are two reasons it is constructed this way:

1. To limit the time to download only the necessary graphic elements that change with various actions.

2. To keep elements aligned in a consistent manner for atleast most common browsers and versions.

On the diagram, the blocks that are shaded solid are basically framesets that exist only to contain another frameset.

What I have been trying to do (and after trying literally hundreds of different ways to do it) is the following:

A. onClick within "f2" should trigger these actions:
1. Load new location.href into "f4"
2. Change the background image in "f0", "f3", "f5" and "f6"

B. onClick within "f9" should trigger these actions:
1. Load new location.href into "f4"
2. Change the background image in "f0", "f3", "f5" and "f6"
3. Change the background image in itself

C. Same actions is needed for clicks occuring in "f10" thru "f20" (although not necessary the same locations or images get loaded).

D. onClick in "f7" and "f8" are basically the same as B and C but with one additional complexity: These are Forward/Backward buttons that need to:
1. Get the current location.href in "f4" at time they are clicked on.
2. Apply formula to know which new location should be loaded into "f4"
3. Lad the new location into "f4".
4. Look up which background images are to be loaded into f0,f3,f5, f6
5. Swap those backgrounds.
6. Look up which of the one of the backgrounds needs to be swapped (this will apply only to one of the frames from "f10" thru "f20", which is based upon whatever is loaded into "f4".)

EEEK! It sounds so convoluted but what the user ends up seeing is not particularly fancy but it is clean and coordinated and I really hate to have to dumb down my intentions. My problem has been in getting objects and scripts to be recognized from one frame to the next and I gather I need a better way to address these objects and/or place my scripts in different locations. I've tried using external scripts, scripts just in the parent frame, scripts in each of the child frames, and every other combination I can think of to create local and global variables. Any hints would be GREATLY appreciated and I've got my site temporarly off-line until I can clear this up.
:confused:

joh6nn
05-26-2003, 12:05 AM
can you link to the page this is on? i have a feeling that the approach you're taking here isn't the best solution, but it's hard to say without having something more than a diagram to look at.

lesliej
05-26-2003, 09:26 AM
John-
I had the site off-line while I worked the problems out but I've put it back up again so you can take a look. -

http://ellisjay.com

The image swaps I wanted to do when changing locations are not scripted in there now - or atleast not all of them. I created seperate .html documents to skirt around the image-swap problem with frames[3] since I seem to be able to load new locations okay. But frames[0],[5] and [6] are static for the time being until I can either figure out how to trigger the changeImage scripts or create seperate .html docs for those swaps, too.

I also seem to have lost the functionality for frames[4] where it gets set to vertical scrolling for some locations and no scrollbars for others. Not sure why that stopped operating correctly.

And then the image maps I had on the "Clients", "Services" and Gallery Item Enlargements have also seemed to break. It seems that the syntax I use one day won't work the next or what works off-line when I'm testing won't work when it's posted. . Ah Well. any help you can give me would be great.
TIA-
Leslie

joh6nn
05-27-2003, 07:30 AM
Leslie, you're using a LOT of frames. anything more than 3 is usually too many. whether or not using frames at all is a good idea, is up for debate. i think that most of what you're trying to do here, can be accomplished much more easily using CSS. was there a specific reason you were using frames?

also, so that you know: people HATE when web pages resize their browser window.

lesliej
05-27-2003, 11:19 PM
John-
The only reason I was using so many frames was that it seemed to be the only way I could get control over the position of elements that I wanted to be able to be changed dynamically.

Just trying it with tables or with CSS never produced consistent results during testing, not only as far as cross-browser compatibility but just in being able to get IE 5.2 (on Mac) to produce the same results twice in a row !

So, I was using frames purely out of self-defense. But what at first seemed like a cumbersome compromise that atleast yield the desired results - starting acting up as soon as I tried to cut down on the number of seperate HTML documents by substituting swap-image scripts triggered from another frame.

In some ways, there is almost too much information available both in books and the net, in that for almost every single script fragment or strategy that I could find, I found atleast 10 more that directly contradicted it and have not been able to find a source that can tell me which strategies are outdated, which are best under circumstance "A" but ill-advised under condition "B", etc. So I've been stumbling along by trial and error .

Now a friend (and former programmer from Nemetchek whom I've been a beta tester for) is recommending that I use .php to accomplish what I want. Could be. But at this point, I've never ventured into .php and so before I scrap everything to start a new in an entirely different direction, I'd love to have atleast one other respected opinion that this is indeed the way to go.

As to your comment re: resizing of windows. I appreciate the thought and had intended to include scripting that could automatically adjust the size of each frame proportionately to fit into whatever window size the user preferred. I had delegated this to one of my last tasks though as I was preoccupied with other features first. The odd size of window in the first place was the result of being a spoiled brat with a 22" Apple Studio Monitor set at 1600 x 1024 resolution and not forcing myself to work at a lower resolution right from the start. <g>

joh6nn
05-28-2003, 01:20 AM
Well Leslie, i think i speak for the forum at large when i say, we're more than willing to take as long as necessary to help you get this right. i really do think that CSS is a better answer, though. there isn't any solution that's going to work exactly the way you want it to in more than one browser at a time. the best you can get, is pretty darn close in most browsers.