Skip to content

Instantly share code, notes, and snippets.

View RolandVels's full-sized avatar

Rolands Vels-Zviedris RolandVels

View GitHub Profile
@RolandVels
RolandVels / smoothScroll.js
Created December 8, 2016 09:45
smoothScroll
smoothScroll(1000);
function smoothScroll (duration) {
$('a[href^="#"]').on('click', function(event) {
var target = $( $(this).attr('href') );
if( target.length ) {
event.preventDefault();
$('html,body').animate({
scrollTop: target.offset().top
@RolandVels
RolandVels / carousel.js
Last active December 7, 2016 12:43
Carousel
@RolandVels
RolandVels / buttonUp.js
Last active December 7, 2016 12:45
Scroll up button
//Button "Up"
//Documentation:
//http://api.jquery.com/scrolltop/
//http://api.jquery.com/animate/
$("#top").click(function () {
$("body, html").animate({
scrollTop: 0
}, 800);
return false;
});