mirror of
https://github.com/ZetaKebab/kesper.git
synced 2025-07-03 02:17:38 +00:00
Bouncy ball of love
This commit is contained in:
@ -26,6 +26,8 @@
|
||||
casperFullImg();
|
||||
$(window).smartresize(casperFullImg);
|
||||
|
||||
$(".scroll-down").arctic_scroll();
|
||||
|
||||
});
|
||||
|
||||
}(jQuery));
|
||||
@ -56,4 +58,33 @@
|
||||
// smartresize
|
||||
jQuery.fn[sr] = function(fn){ return fn ? this.bind('resize', debounce(fn)) : this.trigger(sr); };
|
||||
|
||||
})(jQuery,'smartresize');
|
||||
})(jQuery,'smartresize');
|
||||
|
||||
// Arctic Scroll by Paul Adam Davis
|
||||
// https://github.com/PaulAdamDavis/Arctic-Scroll
|
||||
(function ($) {
|
||||
$.fn.arctic_scroll = function (options) {
|
||||
|
||||
var defaults = {
|
||||
elem: $(this),
|
||||
speed: 500
|
||||
};
|
||||
var options = $.extend(defaults, options);
|
||||
|
||||
options.elem.click(function(event){
|
||||
event.preventDefault();
|
||||
var offset = ($(this).attr('data-offset')) ? $(this).attr('data-offset') : false,
|
||||
position = ($(this).attr('data-position')) ? $(this).attr('data-position') : false;
|
||||
if (offset) {
|
||||
var toMove = parseInt(offset);
|
||||
$('html,body').stop(true, false).animate({scrollTop: ($(this.hash).offset().top + toMove) }, options.speed);
|
||||
} else if (position) {
|
||||
var toMove = parseInt(position);
|
||||
$('html,body').stop(true, false).animate({scrollTop: toMove }, options.speed);
|
||||
} else {
|
||||
$('html,body').stop(true, false).animate({scrollTop: ($(this.hash).offset().top) }, options.speed);
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
})(jQuery);
|
Reference in New Issue
Block a user