Jump to content
Search Community

Hibernate

Members
  • Posts

    5
  • Joined

  • Last visited

Hibernate's Achievements

0

Reputation

  1. works fine! thanks... btw: a other native implementation that works good http://www.kirupa.com/html5/smooth_parallax_scrolling.htm
  2. hmmm... my goal is the same "move" at parallax image (header) and normal content with "ease: Power1.easeOut"
  3. sorry - look at the source code => I have a separate file without <spript>-Tags...
  4. 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>
×
×
  • Create New...