Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to use parallax scrolling?

    • 0
    • 1
    • 1
    • 1
    • 0
    • 0
    • 0
    • 0
    • 611
    Comment on it

    HI all,

    Parallax scrolling is very popular now days in website making. it is not very difficult you just have to understand some basic method to use it.

    Below is an example which will shows you how it works.

    HTML:-

    <section class="mainWrap">
        <div></div>
        <div></div>
        <div></div>
        <div></div>
        <div></div>
        <div></div>
    </section>
    

    CSS:-

    .mainWrap div{height: 300px;}
        div{background: url("http://www.rtcc.org/files/2012/10/bigstock-nature-pathway-in-the-forest-cropped1.jpg") no-repeat fixed center top;}
        div:nth-child(2){background: url(http://freephotos.atguru.in/hdphotos/best-cover-photos-of-nature/facebook-cover-nature-cover-600x300.png)  no-repeat fixed center top;;}
        div:nth-child(3){background: url(http://enpundit.s3.amazonaws.com/wp-content/uploads/2011/11/nature-design-gardens.jpg)  no-repeat fixed center top;; }
        div:nth-child(4){background: url(http://2.bp.blogspot.com/-DMOPikA5xmg/UKjd0wA7iWI/AAAAAAAATU0/C60C35k8IQ8/s1600/halong-bay-vietnam.jpg)  no-repeat fixed center top;;}
        div:nth-child(5){background: url(http://www.mayrhofen.at/picture/10001745.jpg)  no-repeat fixed center top;;}
        div:nth-child(6){background: url(http://www.thedailyriff.com/nature.abstract.jpg)  no-repeat fixed center top;;}
    

    output:-

    Trick behind parallax scrolling :-

    You need to add background-attachment:fixed

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: