1

Im using the jQuery.ScrollTo library right now like this to go directly to different selectors on the page:

var content = [$('#first'), $('#second'), $('#third'), $('#fourth'), $('#fifth')];
var idNumber = 0;
var max = content.length - 1;
$('#down').click(function () {
    if (idNumber < max) {
        idNumber += 1;
        $('div').scrollTo(content[idNumber], 1000);
    }
});
$('#up').click(function () {
    if (idNumber >= 1) {
        idNumber -= 1;
        $('div').scrollTo(content[idNumber], 1000);
    }
});

but what I want instead of triggering the event from a button I want the same effect with a one scroll, exactly like this page: http://www.myprovence.fr/#p_home

bangerang
  • 473
  • 1
  • 6
  • 15
  • look at this answer: http://stackoverflow.com/questions/8189840/get-mouse-wheel-events-in-jquery there u will find how to use mouse scroll events with jquery – x4rf41 Feb 27 '13 at 16:59
  • @x4rf41 that's a great plugin, thanks! but I just want to trigger one event not several, which is the case now with the .mousewheel(). Something like a callback when the one scrollTo event is done? – bangerang Feb 27 '13 at 17:20

0 Answers0