A semantic search engine for source code https://bitshift.benkurtovic.com/
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

12345678910111213141516171819
  1. /*
  2. * @file Implements a parallax effect on the about page.
  3. */
  4. var lastVertPos = $(window).scrollTop();
  5. /*
  6. * Scroll `div#img-[1-4]` at a greater speed than the text, producing a
  7. * parallax effect.
  8. */
  9. $(window).scroll(function(e){
  10. var currVertPos = $(window).scrollTop();
  11. var delta = currVertPos - lastVertPos;
  12. $(".bg").each(function(){
  13. $(this).css("top", parseFloat($(this).css("top")) -
  14. delta * $(this).attr("speed") + "px");
  15. });
  16. lastVertPos = currVertPos;
  17. });