Scroll To Top

Enter a query to search our site. Note that you can use "*" and "?" as wildcards. Enclosing more than one word in double quotes ("CSS Layout") will search for the exact phrase.

PVII Knowledge Base

1. Select a product ...
2. Select category ...
3. Search the Knowledge Base...

Question #265

After navigating through the different tabs of a Accordion Panel Magic 2 (APM2) system, is there a way to have the Reload and back buttons to go to the last active panel instead of always going to panel #1?

The Answer

Prepared Apr. 2009 by Gerry Jacobsen, PVII

The normal browser Back and Reload button behavior is to restore the page to its initial starting state, however, a tweak can be applied to the Accordion Panel Magic 2 (APM2) system to have the page display with the last viewed panel as the open or active panel.

Here's how:

1. Open the p7APMscripts.js file and locate this block of code, around line 495:

  else{
      P7_APMopen(a,bp,tg,an,rt);
  }
  return m;

2. Add a new line directly after the second line, then copy and paste this:

    window.location.hash="#apm"+a.id.replace('p7APMt','');

into the new line so that the code block now looks like this:

  else{
     P7_APMopen(a,bp,tg,an,rt);
     window.location.hash="#apm"+a.id.replace('p7APMt','');
  }
  return m;

 

3. Locate this around line 529:

   P7_APMclose(tB.p7APMtrig[i],null,1);

and change the word null to the number 1, so it now looks like this:

   P7_APMclose(tB.p7APMtrig[i],1,1);

4. Save the file.

That's it. The system will now append a page anchor to the page address so that the APM2 system can re-open to the last opened panel whenever the user goes back to the page. If the user bookmarks the address, the page will also open to the panel that was open at the time they bookmarked the page.

Back to the questions list