-
Notifications
You must be signed in to change notification settings - Fork 23
Wiki Pages: Home | Setup | Options | Methods | Callbacks | Log
- More specific check to fix oldIE bug. See pull #13. Thanks daverodriguez!
- Preferentially use HTML5 History API. See pull #11. Thanks daverodriguez!
- Add
offsetTop
option - adds a top offset value (pixels) or jQuery element (height is measured), of any top menu or gap. - Add
scrollOnInit
option - prevents initial scroll to top menu item when set tofalse
(default value). - General code cleanup
- Remove some browser specific code.
- Add event namespacing.
- Only update hash if changed.
- Anchors not inside of content blocks are now clickable
- Previously, any anchor link in the menu would update to show that the ID was in view, but it was not clickable.
- As before, any anchors within a defined content block (set by the
contentClass
option) will target the top of the content block.
- Modified
animationTime
option to now accept a function-
The
animationTime
option still accepts a time in milliseconds. -
To set an
animationTime
based on the scroll distance, use any desired calculation method and return a time in milliseconds. -
For example, in this snippet, the distance is halfed and returned as an animation time in milliseconds:
animationTime: function( distance ) { // distance in pixels; return time in milliseconds // 1000 pixels => 500ms; 10000 pixels => 5000ms return distance / 2; }
-
- Only call
updateHash
if theuseHash
option is set. Fixes issue #10.
- Hash now updates while scrolling. Fixes issue #7.
- Merged in a fix (pull #9) for a selector that was not properly scoped. Thanks jewlofthelotus!
- Merged in optimization by annavester. Thanks for contributing!
- Added gitignore and gitattribute files.
- Added manifest file for jQuery plugin registry site.
-
Added
stopOnInteraction
option- When
true
any interaction the user performs during scrolling will stop the animation. - If this option is
false
, the animation can not be interrupted unless astop()
function is called on the document body -$('body').stop()
. - Interactions include pressing any key on the keyboard, clicking the mouse on the page or using the mousewheel.
- In previous versions, this functionality was built in and always enabled this option was added to allow the plugin to work by stepping through the sections - see the new section stepper demo.
- Default value is
true
.
- When
-
Added an
initialized
callback function:-
This callback is executed after the plugin has finished initialization.
-
Set up the option as follows:
$("#menu").visualNav({ initialized : function(vNav){ // vNav = visualNav object (api) } });
-
-
Added a
changed
callback function:-
This callback is executed every time the menu changes.
-
So going from the first to third menu item, the
changed
callback will fire off twice (2nd & 3rd menu item), then fire off thecomplete
callback. -
Set up the option as follows:
$("#menu").visualNav({ changed : function(vNav){ // vNav = visualNav object (api) } });
-
-
Added
currentContent
option- Set this option with the css class name to style the current content.
- In the section stepper demo, you can see that it changes the background color of the current section.
- This class name is added to the content when the menu updates.
- A jQuery object of the current content can be accessed through the api as
vNav.$curContent
. - The default value is
'current'
.
-
Added an update method
-
If the visualNav plugin needs to be updated with any changes to the menu or content, this API method can be used.
-
Either method below will update the menu
// update visualNav, any variables will be ignored $('#menu').visualNav(); // or use the api to update the plugin var vNav = $('#menu').data('visualNav'); vNav.update();
-
-
Updated the
contentLinks
andexternalLinks
options:- These options contain the class name that could only be applied to a link
<a>
to work properly - Now any element with either of these class names can contain links
- These options contain the class name that could only be applied to a link
- Added an
externalLinks
option:- This option contains the class name applied to links within the navigation menu which are ignored by this plugin.
- Use it for external page links or popups, as needed.
- The default value is
"external"
.
- Added a Bootstrap demo.
- Changed the HTML basic layout to include a inner content wrapper
- This inner wrapper now has the styling applied to it - border, background, padding, etc.
- The outer "content" wrapper provides the margins to allow for a side menu or top menu (like Bootstrap) and keep the content in view, not under the menu.
- visualNav updated to work with horizontal and/or vertical page layouts.
- Added a second demo to show the menu working with both horizontal and vertical content.
- Added
useHash
option that turns on (true, default setting) or off (false) the updating of the hash in the url. - Added
fitContent
option that resizes the content when true (false by default). For use when horizontal content is present. - Added
easing
option which adds easing to horizontal and/or vertical scrolling. - Added animation to reposition the content on initial load if a hash tag is present.
- Fixed a bug where links contained in the menu wrapper, but not inside the menu wouldn't work - see link to other demo (in the demo) to see what I mean.
- Updated demo page to include a play/stop slideshow button. I decided to add the code to the "index.html" page instead of to the plugin core because I wasn't sure if this functionality is really necessary. Get the code above or by viewing the demo page source.
- Corrected some grammar in the documentation.
- Added
contentLinks
option that targets elements on the page (e.g. links). These links will smooth scroll to the targeted ID (any ID on the page) just like the menu. - Added a new Method to control the script without using a link. All you need to do is call the script with the section ID with either method described above.
- This new Method will allow you to smoothly scroll to any ID on the page.
- Changed
contentClass
value from '.content' to 'content'. It shouldn't have had the period in front in the first place.
- Removed required anchor (
a
) before the content block - changed base HTML. The script now targets the content block.
- Added
inViewClass
option which is applied to the menu for all content that is in view (margin adjusted). - Added
contentClass
option which targets the main page content divs. This was added to work with a new in viewport algorithm. - Changed in viewport algorithm - the original version worked fine as long as you didn't use PageUp/PageDown.
- Removed
TopRange
option. - Removed
topMargin
option.
- Initial Release