The page has a block <div id="menu"> and <div id="content"> . The content of the content block (page1.php, page2.php, ...) is loaded by reference using jquery load. The menu depends on the loaded page. How can I make the menu displayed depending on the content of the <div id="content"> block?

  • An example can be seen? - Yaroslav Molchan
  • "Menu depends on page loaded." The text of the menu is different or the type of menu (the active item, for example, changes? - AndryG

1 answer 1

Each link to the page should have its id, for example, a link to page1.php will have id="page1" .

Further you just write:

 $('#page1').click() { //если нажали на page1.php } $('#page2').click() { //если нажали на page2.php }