title: Highlight menu item depending on anchor selected?
body: <p>I'm using the following tutorial to create a one page website:
  <a href="http://www.insitedesignlab.com/how-to-make-a-single-page-website/" rel="nofollow">http://www.insitedesignlab.com/how-to-make-a-single-page-website/</a></p>
  
  <p>Is it possible to change the color of the menu item depending on what anchor is selected?</p>
  
  <p>This is how I've setup the menu</p>
  
  <pre><code>        &lt;?php $current = $post-&gt;ID; $counter = 1; $mypages = get_pages(array('sort_column' =&gt; 'menu_order'));
              foreach( $mypages as $page ) { ?&gt;
              &lt;?php if ($current == $page-&gt;ID) { ?&gt;
                  &lt;li&gt;&lt;a style="color:white!IMPORTANT;" id="menu&lt;?php echo $counter; ?&gt;" href="#section&lt;?php echo $counter; ?&gt;"&gt;&lt;?php echo $page-&gt;post_title; ?&gt;&lt;/a&gt;&lt;/li&gt;
              &lt;?php } else { ?&gt;
                  &lt;li&gt;&lt;a id="menu&lt;?php echo $counter; ?&gt;" href="#section&lt;?php echo $counter; ?&gt;"&gt;&lt;?php echo $page-&gt;post_title; ?&gt;&lt;/a&gt;&lt;/li&gt;
              &lt;?php } ?&gt;
          &lt;?php $counter++; } ?&gt;
  </code></pre>
  
  <p>So each menu iterates by 1 each time it loops.</p>