View Full Version : dynamic framesets
merdolator
11-13-2002, 10:46 PM
ok ... here is a problem that perplexes me.
lets say we have a frameset with a top frame for the site's name and stuff... a left frame with a menu 3 links total... and it is a javascript rollover image menu... in the 3rd frame we have the body.
now... lets say my links are:
1)home
2)services
3)contact
just to keep it simple
lets say that i have clicked on services. the 'down' state of the button is present in the left or menu frame... however, if you hit the Refresh button on the browser window... it resets the menu to the default state (home) even though the user is on the 'services' page.
what script needs to be put in there to:
1) reload frameset while
2) resetting menu items according to 'body' frame's document
?
complex to me.
the other fun part of this will be incorporating a script that uses the '?' on the end of the url to add the page located in the body to the actual url displayed in the browser address bar. (instead of just seeing the master frame's location)
any tutorials, suggestions, tips, brainstorming is very much appreciated!
DCElliott
11-14-2002, 09:01 AM
Repeat after me: "Frames are Evil"
"Frames are Seductive"
"Frames only appear to make things easier"
Most developers go through a frames phase and then mature ;)
Have you tried an <iframe> page instead?
merdolator
11-14-2002, 10:58 AM
hahaha...
frames are sort of evil man. i agree... but unfortunately due to the content production for the site... the site owner and i felt that this was the best way to create our skeleton. each 'service' is a separate page that can be added or removed as it becomes available without me having to change code on every page with an addition of content.
i have taken most of the evil out of it with the exception of these complex lil adjustments.
on other projects, i have made use of the iframe as suggested, but unfortunately it is not the solution to my situation... if that makes me immature then fine... i have been builing websites for about 3 years... so by no means am i an expert. still, i look at this as a challenge and not a problem i guess. i know it can be done.
it has to be something to the effect of capturing the location of the body frame and reloading it into the frameset... while simultaneously checking the menu to make sure that the correct button in he navigation is in it's "down"state. (i know ... sounds simpler than implemented)
i have some fragmented code that i have been working on... i will post it once i feel it is closer to being correct. (i am not just wanting someone to magically make it all better for me... i really want to learn what i need to do to make it work)
in the meantime... any ideas or applications people have seen where this has been done... please post a link or send comments.
thanks 4 your response DC.
DCElliott
11-14-2002, 11:08 AM
About the mature bit - I was just razzing you. Frames have their place, especially if you can make a site that appears "frameless". The real sign of frame immaturity is when someone has a "home" link in their nav frame that loads the frameset in the "main" frame. Frames within frames reductio ad absurdum.
Depending on your service provider, there are ways of serving pages with frame-like content, but not the frames, using SSI, ASP, etc., or assembling static pages programmatically (sp?) so that they can be recreated whenever the main content changes.
merdolator
11-14-2002, 11:23 AM
Originally posted by DCElliott
About the mature bit - I was just razzing you.
no offense taken whatsoever... i am definitely down with the immaturity when i want to be. ;)
Depending on your service provider, there are ways of serving pages with frame-like content, but not the frames, using SSI, ASP, etc., or assembling static pages programmatically (sp?) so that they can be recreated whenever the main content changes.
unfortunately .asp is over my head at this point. i am however learning some .php... maybe that would be another solution. (?) school me.
my frames site is in fact seamless as you had suggested. it looks like one continuous page and no my whole frameset doesnt load into the frameset. plus... if you have to scroll the body content... the menu and top banner frame stay put.
i got that pretty squared away... but like i was saying... i am working on some code now and maybe someone can help me debug it once its presentable... javascripting is pretty tedious when staring at a screen for 12 hours.
merdolator
11-24-2002, 12:37 AM
okay... i WAS still working on this... for real... but ran across some documentation that helps complete my idea.
http://www.xs4all.nl/~ppk/js/framecustom.html
it's funny however, when you look on the top of that page... it's supposed to be in a frameset itself... and then by clicking to force to frames, it uses the very script it is showing you.
only thing is, i would rather add an onPageLoad script that auto forces the page to a frame that displays its path in the address bar. more to figure out.
will reply to myself again with newfound documentation and successful developments... haha. i guess i hope that maybe someone will find this useful besides me in the long run. the info on this topic seems to be hard to find. or at least the resources are. most people give up on frames beofre taking the time to figure it out. who can blame them. there are plenty of other tools out there with iframes and divs. i choose to be difficult i suppose.
oh well, back to it.
"frames are evil, frames are evil..."
DCElliott
11-24-2002, 10:15 AM
your posts are like reading e.e.cummings poetry ;)
i'd be interested in seeing what you come up with. all this hard mental effort must be difficult seeing as you live where there is no oxygen.
Master Austin
11-25-2002, 03:40 AM
I use frames all the time. You just have to know how to use them really. If you have like 7 different framesets on the page than thats not good. Just do this.
Logo Frame or decoration.
Sidebar.
And content. No more stuff than that.
As for the refresh thing. If you right click inside of one of the frames and hit refresh it will refresh that part only.
merdolator
11-25-2002, 10:18 AM
Originally posted by Master Austin
I use frames all the time. You just have to know how to use them really. If you have like 7 different framesets on the page than thats not good. Just do this.
Logo Frame or decoration.
Sidebar.
And content. No more stuff than that.
As for the refresh thing. If you right click inside of one of the frames and hit refresh it will refresh that part only.
thanks for your input.
i have 4 frames in my masterframeset.
- banner (top)
- menu
- body
- footer (fixed copyright and sitemap link)
here's the point of WHY i am doing what i am.
Bill Shmoe comes to my site.
loves a particular page 3 clicks deep.
master frameset shows http://domain.com... not domain.com/topic2/article3/page.html. so if he goes to copy that page fromt he address bar to paste in an email to his buddy... well he aint gettin there without navigating like Bill did. again. too much work for the user. i want the user to have an easy and nonthinking experience. thats what the webmaster/developer's job is. its not to say we have tomato soup, chicken soup and split pea, but you will eat tomato only. it is to allow the user to get whatever soup we offer in the easiest way possible. the harder it is to get the soup, more likely it is the customer will leave or give up. dig?
the other side of why i am doing this is to not confuse the user, make it simpler, and to create seamless continuity.
if they click on link 'b' in the menu frame... and hit refresh on the browser window... i want that link 'b' button to be shown in its down state... without asking the user to "please click in the menu frame and hit refresh so that it doesn't look like i can't figure out some script to make your life easier." sure for me it may work, but its not practical.
there just has to be a way to autorefresh upon body load with a variable that is passed thru the frameset via the body to the menu. its easier said that done... but i will succeed.
check out this site to see what i am talking about. i am trying to revamp it after it's original launch where i was given the info from the owner in small doses.
http://www.sonicsourcemanagement.com
keep in mind that the site has more content coming in as the pool of representation increases and the scope of services widens. this is a new business service and a very new site meant to be informational and allow for streamlining email communication.
vBulletin® v3.7.2, Copyright ©2000-2008, Jelsoft Enterprises Ltd.