On the main page (stom-mva ru), some menu items (links) lead to other pages, other items are changed to divs (the main “content”) with the help of this code:
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script> <script> $(function() { $('.m').on('click', function(e) { e.preventDefault(); $('.content').each(function() { $(this).css('display', 'none'); }); var block = $(this).attr('href'); $(block).css('display', 'block'); }); }); </script> and
<li ><a href="#about" class="m" id="abo"> </a></li> <li ><a href="uslugi.html" id="usl"></a></li> <li ><a href="gallery.html" id="gall" ></a></li> <li ><a href="#contacts" class="m" id="cont" ></a></li> ...
<div class="content" id="about"> ...
Question: how to make it so that this menu would work correctly from other pages of the site? Those. so that on other pages, links that lead to "additional" divs on the main page work correctly, and automatically show the necessary blocks?
As I think, there can be 2 ways here: 1. correctly specify these “dynamic” blocks in the menu links. (but how? I know only what is used in CMS, but php! is there, and will they be CNC then?) 2. in the script, finish the "triggering" function when switching from "external" links. But how?