Naveen Yogi, Naveen Web Design, Web Designing

html,css,html5,css3,javascript,jquery blog there is queries with solution regarding the web designing

Pages

  • Home
  • HTML & CSS
  • jQuery

Tuesday, 20 June 2017

How to apply simple parallax scrolling

function parallax(){
    var scrolled = $(window).scrollTop();
    $('.bg').css('top', -(scrolled * 0.2) + 'px');
}
$(window).scroll(function(e){
    parallax();
}); 
Posted by naveenwebdesign at 23:42
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

About Me

naveenwebdesign
View my complete profile

Blog Archive

  • ►  2023 (1)
    • ►  February (1)
  • ►  2022 (1)
    • ►  April (1)
  • ►  2019 (6)
    • ►  November (1)
    • ►  July (1)
    • ►  June (1)
    • ►  April (1)
    • ►  March (2)
  • ►  2018 (7)
    • ►  April (4)
    • ►  March (2)
    • ►  January (1)
  • ▼  2017 (16)
    • ►  September (1)
    • ►  August (1)
    • ►  July (2)
    • ▼  June (2)
      • How to apply simple parallax scrolling
      • How to apply parallax effect (changing active clas...
    • ►  May (1)
    • ►  April (5)
    • ►  March (1)
    • ►  February (3)
  • ►  2016 (13)
    • ►  July (9)
    • ►  June (2)
    • ►  May (2)
Simple theme. Powered by Blogger.