stdcerr
stdcerr

Reputation: 15598

smooth not just parallax scrolling in bootstrap

I guess I've figured out how to implement parallax scrolling with bootstrap with help from http://mode87.com/untame/demo/parallax/ but I can't figure out how to do a smooth scroll in bootstrap like it's done in SMINT: http://www.outyear.co.uk/smint/demo/ - how can I do this in bootstrap? So far I have this: http://ronhome.no-ip.org/bootstrap/

Thanks!

Upvotes: 0

Views: 4269

Answers (1)

Vikas Ghodke
Vikas Ghodke

Reputation: 6655

See the Demo here

HTML

<ul>
    <li><a href="#one">Menu</a></li>
    <li><a href="#two">Menu</a></li>
    <li><a href="#three">Menu</a></li>
</ul>
<div id="one">
    Section one
</div>
<div id="two">
    Section two
</div>
<div id="three">
    section three
</div>

CSS

#one {
    height: 400px;
}
#two {
    height: 400px;
}
#three {
    height: 400px;
}

JS

$('a').click(function(){
    $('html, body').animate({
        scrollTop: $( $.attr(this, 'href') ).offset().top
    }, 500);
    return false;
});

Upvotes: 4

Related Questions