Statistiques
| Révision :

root / tei / js / jquery.localscoll.init.js @ 2

Historique | Voir | Annoter | Télécharger (1,14 ko)

1 2 mingarao
jQuery(function( $ ){
2 2 mingarao
        /**
3 2 mingarao
         * Most jQuery.localScroll's settings, actually belong to jQuery.ScrollTo, check it's demo for an example of each option.
4 2 mingarao
         * @see http://flesler.demos.com/jquery/scrollTo/
5 2 mingarao
         * You can use EVERY single setting of jQuery.ScrollTo, in the settings hash you send to jQuery.LocalScroll.
6 2 mingarao
         */
7 2 mingarao
8 2 mingarao
        // The default axis is 'y', but in this demo, I want to scroll both
9 2 mingarao
        // You can modify any default like this
10 2 mingarao
        $.localScroll.defaults.axis = 'xy';
11 2 mingarao
12 2 mingarao
        // Scroll initially if there's a hash (#something) in the url
13 2 mingarao
        $.localScroll.hash({
14 2 mingarao
                target: '#content', // Could be a selector or a jQuery object too.
15 2 mingarao
                queue:true,
16 2 mingarao
                duration:1500
17 2 mingarao
        });
18 2 mingarao
19 2 mingarao
        /**
20 2 mingarao
         * NOTE: I use $.localScroll instead of $('#navigation').localScroll() so I
21 2 mingarao
         * also affect the >> and << links. I want every link in the page to scroll.
22 2 mingarao
         */
23 2 mingarao
        $.localScroll({
24 2 mingarao
                target: '#content', // could be a selector or a jQuery object too.
25 2 mingarao
                queue:true,
26 2 mingarao
                duration:1000,
27 2 mingarao
                hash:true,
28 2 mingarao
                onBefore:function( e, anchor, $target ){
29 2 mingarao
                        // The 'this' is the settings object, can be modified
30 2 mingarao
                },
31 2 mingarao
                onAfter:function( anchor, settings ){
32 2 mingarao
                        // The 'this' contains the scrolled element (#content)
33 2 mingarao
                }
34 2 mingarao
        });
35 2 mingarao
});