title: jQuery mobile custom script working only on main mage in a multi-page layout
body: <p>I have a menu script in a seperate .js file:</p>
  
  <pre><code>jQuery(document).ready(function ($) {
  $("#mmenu").hide();
  $("#cover").hide();
  var wys = $('#mmenu').height();
  var open = false;
  $(".mtoggle").click(function () {
      $("#mmenu").slideToggle(500);
      $("#cover").fadeToggle("400", "swing");
      if (open) {
          $(window).off('scroll.menuopen');
      } else {
          $(window).on('scroll.menuopen', scrollHandler);
          $(window).scrollTop(wys);
      }
      open = !open;
  });
  function scrollHandler(e) {
      if ($(window).scrollTop() &gt; wys) {
          var limit = wys + 50;
          $(window).scrollTop(limit);
      }
  }});
  </code></pre>
  
  <p>And a multi-page layout, where i determine new pages inside one html file like that:</p>
  
  <pre><code>&lt;section data-role="page" id="index" data-theme="a"&gt;, &lt;section data-role="page" id="page2" data-theme="a"&gt;, &lt;section data-role="page" id="page3" data-theme="a"&gt;
  </code></pre>
  
  <p>The problem is that the menu-toggling script works only on the section #index, it doesn't affect the menu on other #pages. What should i do to fix it?</p>