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.
 
 
 
 
 
 

16 regels
384 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")) -
  7. delta * $(this).attr("speed") + "px");
  8. });
  9. lastVertPos = currVertPos;
  10. }
  11. $(window).scroll(function(e){
  12. parallax();
  13. });