don´t works perfect
In this time, I have two scrits to make a sooth scrool at mouse wheel for IE, Safari, Chome and one for a parallax move.
So, I think its possible to change to GSAP
This is a site with two Scrips
http://www.gut-cert.de/auf-einen-blick.html
and this with one
http://www.gut-cert.de/dienstleistungen.html
I implement the code from
http://stackoverflow.com/questions/19445546/greensock-js-smooth-parallax-on-mousewheel
but I see no parallax effect
<script src="http://cdnjs.cloudflare.com/ajax/libs/gsap/latest/TweenMax.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/gsap/latest/plugins/ScrollToPlugin.min.js"></script>
<script>
$(function(){
var $window = $(window); //Window object
var $parallax = document.getElementById('container_header'); //parallax object
var scrollTime = 1.2; //Scroll time
var scrollDistance = 170; //Distance. Use smaller value for shorter scroll and greater value for longer scroll
var parallaxDistance = 150;
$window.on("mousewheel DOMMouseScroll", function(event){
event.preventDefault();
var delta = event.originalEvent.wheelDelta/120 || -event.originalEvent.detail/3;
var scrollTop = $window.scrollTop();
var finalScroll = scrollTop - parseInt(delta*scrollDistance);
var finalParallax = scrollTop - parseInt(delta*parallaxDistance);
TweenMax.to($window, scrollTime, {
scrollTo : { y: finalScroll, autoKill:true },
ease: Power1.easeOut, //For more easing functions see http://api.greensock.com/js/com/greensock/easing/package-detail.html
autoKill: true,
overwrite: 5
});
TweenMax.to($parallax , scrollTime, {
//y: finalParallax, //TEST
scrollTo : { y: finalParallax, autoKill:true },
ease: Power1.easeOut, //For more easing functions see http://api.greensock.com/js/com/greensock/easing/package-detail.html
autoKill: true,
overwrite: 5
});
});
});
</script>