Activating the menus items when moving only the scroll and <h2 /> appears on the window
<p>I'm trying to do the next thing with jQuery. I want that when you move throw the <code>&lt;h2 /&gt;</code> headings that higlight the right menu. My code is next to the images. Actually I only have the functionality that moves the menu and that when you click is moved and highlighted. I need do the same but with only moving the scrollbar.</p>

<p>Actual example working: <a href="http://jsfiddle.net/fAcTX/1/" rel="nofollow">http://jsfiddle.net/fAcTX/1/</a></p>

<p><img src="http://i.stack.imgur.com/tgONW.jpg" alt="enter image description here"></p>

<hr>

<p><img src="http://i.stack.imgur.com/j3l19.jpg" alt="enter image description here"></p>

<hr>

<p><img src="http://i.stack.imgur.com/pE9iZ.jpg" alt="enter image description here"></p>

<pre><code>    &lt;div id="floating-divs"&gt;
        &lt;div id="box-sidebar-menu" class="abt-ptn-sidebar-widget box-sidebar-menu-float"&gt;
            &lt;ul&gt;
                &lt;li class="active"&gt;&lt;a href="#header1"&gt;Peter Saville&lt;/a&gt;&lt;/li&gt;
                &lt;li&gt;&lt;a href="#header2"&gt;About Saville Consulting&lt;/a&gt;&lt;/li&gt;
                &lt;li&gt;&lt;a href="#header3"&gt;Clients&lt;/a&gt;&lt;/li&gt;
            &lt;/ul&gt;
        &lt;/div&gt;
    &lt;/div&gt;

&lt;script&gt;
    (function($) {
        $.fn.floatmenu = function(options) {
            // merges the given options with some default options
            var options = $.extend({
                topPadding: 10
            }, options);

            return this.each(function() {
                // fetches and initializes the current element.
                var obj = $(this);

                var position = $(obj).offset(),
                cssPosition = $(obj).css('position');

                // tests if a "position" was set on the element, if not, sets a default
                if(cssPosition == '') {
                    cssPosition = 'static';
                }

                // attaches an event to listen for scroll events
                $(window).scroll(function(e) {
                    // if the window's inner frame passes the top of the element,
                    // start moving the menu
                    if($(window).scrollTop() &gt; (position.top - Number(options.topPadding))) {
                        $(obj).
                            css('position','fixed').
                            css('top', options.topPadding);
                    }
                    // the window's inner frame has not passed the menu, reset
                    // the objects position
                    else {
                        $(obj).css('position', cssPosition);
                    }
                });
            });
        };
    })(jQuery);

    $(document).ready(function(){
        $("#floating-divs").floatmenu();

        $("#box-sidebar-menu li a").click(function(){
            $("#box-sidebar-menu li").removeClass("active");
            $(this).parent().addClass("active");
        });
    });
&lt;/script&gt;
</code></pre>
