Skip to content
Mottie edited this page Jan 27, 2015 · 6 revisions

Wiki Pages: Home | Setup | Options | Methods | Callbacks | Log

Methods

Change Target

  • Targets for this method can be either an ID ("#") or class ("."). The string must start with either of these before it will work.

  • You can set the selected menu item (smooth scroll to the block) using any of the following methods:

    // '#blog' can be any ID on the page
    $('#menu').visualNav('#blog');
    
    // or use these alternative methods
    // $('#menu').data('visualNav').animate('#blog');
    // $('#menu').getvisualNav().animate('#blog');
  • A class can also be used, if more than one object is included in the class, the first one will be targeted.

    // '.content' is the class of the content block - this targets first content block
    $('#menu').visualNav('.content:first');
    
    // targets fourth (zero based index) content block
    $('#menu').visualNav('.content:eq(3)');
    
    // Target any object with a class as well. In the demo, you can target the second image caption as follows:
    $('#menu').visualNav('.test-link:last'); // targets last image link

Update (added in v2.4)

  • If the menu items or content changes in any way, you can update visualNav by calling the plugin again

    // update visualNav
    $('#menu').visualNav();
    
    // or use either of these alternative methods
    // $('#menu').data('visualNav').update();
    // $('#menu').getvisualNav().update();

Clone this wiki locally