Lunarpages Web Hosting Forum

Author Topic: Help: controling the BACK using <DIV>s  (Read 1157 times)

Offline amadorer

  • Trekkie
  • **
  • Posts: 15
Help: controling the BACK using <DIV>s
« on: March 30, 2005, 07:40:11 PM »
I'll try to make this short:

I have the main page of a web site using a menu that simply shows different <DIV>s when selected

I need to control when the user goes to one option thru the menu, because when he/she presses the "Back" button of the browser, it goes out of the site (which is the right behaivour), but the idea is that when the "Back" is pressed, it goes to the main page again with the main <DIV> shown

the pseudo code is something like this:



 [script]
   menu option 1: onClick="showDiv(1)"
   menu option 2: onClick="showDiv(2)"
   menu option 3: onClick="showDiv(3)"
 [/script]

 [DivMain]
  This is the main page
 [/DivMain]

 [Div1]
  Product 1
 [/Div1]

 [Div2]
  Product 2
 [/Div2]

 [Div3]
  Product 3
 [/Div3]



The problem I have is that as all the [DIV] are defined in one page (the main page), the history of the browser is not modified since the user is not changing the page itself but just move within the same page showing and hidding [DIV] tags

If somebody knows a good trick, please give me a hand (if some code can be send, great !!!)

Or if need something else to be explained, just let me know

Thanks beforehand !!!
Regards,
Erick