Hello All,
I've been messing around with the bootstrap version of the "technologic" theme...how would one add smooth scroll to this theme?
In the old RSD I could make it happen, but now I'm a bit lost.
As always, thanks for the help.
MJ
Smooth Scroll with V2 - Post ID 272867
First apply the class "smooth-scroll" on the element and then paste this markup into the footer.
<!-- SMOOTH SCROLL -->
<script>
$(function() {
$('a.smooth-scroll[href*="#"]:not([href="#"])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top
}, 1000);
return false;
}
}
});
});
</script>
<script>
$(function() {
$('a.smooth-scroll[href*="#"]:not([href="#"])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top
}, 1000);
return false;
}
}
});
});
</script>
Learn the essentials with these quick tips for Responsive Site Designer, Responsive Email Designer, Foundation Framer, and the new Bootstrap Builder. You'll be making awesome, code-free responsive websites and newsletters like a boss.
Thanks! I'll give it try when I get back
Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.