ThomasJSmart
Programmer
- Sep 16, 2002
- 634
Ok this is the situation
i have 3 frames: menu, left, content
in frame "menu" there are links
menu1
menu2
menu3
when one of these menu links is clicked 3 things should happen:
1. frame&page "menu" needs to know what menu was chosen so it can highlight the active menu. CSS a:active doesnt work good enough to do this properly. currently im using a php script to set the style according to a passed GET var.(menu.php?page=menu1)
2. frame&page "left" also needs to know what menu was chosen so it can display an image according to what menu is chosen (menu1.jpg)
3. frame "content" needs to go to the selected menu page (menu1.html)
currently im doing all this with a big messy link/onclick combo that goes something like this
this works fine
except
the back button is now a mess! i need to click back 3 times befor it puts the content frame back to the previous page, and after 1 and 2 clicks the menu and left frame change showing a wrong image and wrong highlited menu compared to the content.
why am i using frames u ask? well i could put left and content into 1 frame but i would rather solve this problem
also in left frame there is a little menu thing that would scroll with content if they where in the same frame.
im asuming theres somekind of javascript solution to this but im not a javascripter, i mean i can find my way through the basic forest of java just these complicated things arent on my level yet
any help apreciated
thanks
Thomas
I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!
i have 3 frames: menu, left, content
in frame "menu" there are links
menu1
menu2
menu3
when one of these menu links is clicked 3 things should happen:
1. frame&page "menu" needs to know what menu was chosen so it can highlight the active menu. CSS a:active doesnt work good enough to do this properly. currently im using a php script to set the style according to a passed GET var.(menu.php?page=menu1)
2. frame&page "left" also needs to know what menu was chosen so it can display an image according to what menu is chosen (menu1.jpg)
3. frame "content" needs to go to the selected menu page (menu1.html)
currently im doing all this with a big messy link/onclick combo that goes something like this
Code:
<a href="menu1.html" target="content" onClick="parent.left.location='menu1left.html'; window.location='menu.php?page=menu1'">menu1</a>
this works fine
why am i using frames u ask? well i could put left and content into 1 frame but i would rather solve this problem
im asuming theres somekind of javascript solution to this but im not a javascripter, i mean i can find my way through the basic forest of java just these complicated things arent on my level yet
any help apreciated
thanks
Thomas
I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!