Advertisement
srikat

Untitled

May 4th, 2016
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. jQuery(function( $ ){
  2.  
  3. // Set the URL of Posts page's featured image (if present, otherwise a default image) as background image for .blog-parallax-section
  4. $(".blog-parallax-section").css("background-image", "url('" + [BlogPlxBkgrdImg.src] + "')");
  5.  
  6. // Enable parallax
  7. $(window).scroll(function(){
  8.  
  9. if ( $(window).width() > 1024 ) {
  10.  
  11. scrolltop = $(window).scrollTop()
  12. scrollwindow = scrolltop + $(window).height();
  13.  
  14. $(".blog-parallax-section").css("backgroundPosition", "50% " + -(scrolltop/6) + "px");
  15.  
  16. }
  17.  
  18. });
  19.  
  20. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement