A semantic search engine for source code https://bitshift.benkurtovic.com/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

15 rivejä
354 B

  1. var lastVertPos = $(window).scrollTop();
  2. function parallax(){
  3. var currVertPos = $(window).scrollTop();
  4. var delta = currVertPos - lastVertPos;
  5. $(".bg").each(function(){
  6. $(this).css("top", parseFloat($(this).css("top")) - delta * 1.8 + "px");
  7. });
  8. lastVertPos = currVertPos;
  9. }
  10. $(window).scroll(function(e){
  11. parallax();
  12. });