/* parallax plugin v 1.0 author: nino zumstein date : 12.09.2016 */ (function ( $ ) { $.fn.parallax = function(options) { var parallax_element = this; var settings = { speed: '100', ascending: true, delay: '1000' }; if (options) { $.extend(settings, options);} // if true = ascending else descending var ad = "+"; if (!settings['ascending'] == true) { var ad = "-"; } $(window).scroll(function(){ var wscroll = $(this).scrolltop(); parallax_element.css({ "transform" : "translate(0px, "+ ad + wscroll / settings['speed']+"%)", "transition-duration" : settings['delay'] + "ms" }); }); } }(jquery));