ChrisWojcik / single-page-nav

jQuery plugin that provides smooth scrolling and advanced navigation for single page websites.
http://chriswojcik.net/demos/single-page-nav/
161 stars 75 forks source link

Question #20

Closed falm88 closed 7 years ago

falm88 commented 9 years ago

Hi Chris, thanks for the awesome job, I'm trying to change the size in px of the offset option. but I cant find where. Would you help me out?

Thanks a bunch!

Fernando

duncup commented 9 years ago

@falm88 HI bro. I find this in line number 172.

$.fn.singlePageNav.defaults = {
        offset: 0,
        threshold: 120,
        speed: 400,
        currentClass: 'current',
        easing: 'swing',
        updateHash: false,
        filter: '',
        onComplete: false,
        beforeStart: false
    };

I don't know this offset Is it right? One week ago,i use this plug-in. If you just want to fix your nav height,you can use offset. You need see the demo.

 // The actual plugin
            $('.single-page-nav').singlePageNav({
                offset: $('.single-page-nav').outerHeight(),
                filter: ':not(.external)',
                updateHash: true,
                beforeStart: function() {
                    console.log('begin scrolling');
                },
                onComplete: function() {
                    console.log('done scrolling');
                }
            });

If you can't find demo file.Demo file is index.html.Just see it.