pugin curtains

Today’s parallax website tutorial is a detailed explanation of the Parallax Scrolling Effect using Skrollr.js published a few weeks ago. You will learn how to create a simple parallax scrolling website using Skrollr.js plugin. If you haven’t seen the demo already, go and check it out. It will give you a clear understanding of what we are talking about in the sections below. To develop a parallax scrolling website can be a bit scary especially if you do it for the first time, but as you know the practice makes perfect. Take this parallax tutorial as your first step to developing a great looking parallax website. Please note, that this tutorial is suitable for a more advanced developers and attached files are the final files. Simply open index.html, main.css and _main.js and follow the sections below. As a first step we need to include Skrollr.js preferably before the closing body tag. This plugin will do the magic and will animate the element properties on page scroll.

Skrollr is a stand-alone parallax scrolling JavaScript library for mobile (Android, iOS, etc.) and desktop. Initiate the Skrollr inside of the _main.js file. You can log the current scroll position if you need to work out a precise timing and positioning of your animations. Now lets have a look at the markup and Skrollr settings of the individual slides. Section height – 100% of the viewport, resized on page load .hsContainer and .hsContent are two nested containers helping us to center the content vertically on the page. .bcg is a container which takes up 100% width and height of each section and contains our background image. The background image of .bcg is animating from the initial position (data-center) 50% 0px to 50% -100px. This means that the background image moves up by 100px between the start of the scrolling and when the bottom of the #slide-1 hits the top of the viewport (data-top-bottom). Content fading in and out The content of the slide starts at full opacity as specified in data-center attribute and fades out to opacity: 0 when the #slide-1 h2 hits 106 pixels from the top of the viewport, where 106 is the height of our header.

Is this your first project using Skrollr? You might find the data attributes a bit confusing. If that’s the case, download my Skrollr Cheatsheet or: Get my free Skrollr tips and save heaps of time! The data-attribute tip, will save you hours if not days or weeks of figuring out. PLUS you'll get the first 2 videos from the popular Parallax Scrolling Master Class! Enter your email below and I’ll send it right to your inbox! Section height – 310px fixed height
curtain rod finials walmart We are simply animating the background color from dark blue to black.
childrens blackout curtains dunelmdata-0 contains the initial background color and data-top contains the background color to which we are animating when the #slide-2 hits the top of the viewport.
curtains thornton cleveleys

The content fades in when #slide-2 h2 is 206 pixels from the bottom of the viewport and fades out similar way as the #slide-1 content. The background image on this slide is only slightly moving up until the slide is centered in the viewport. Then it’s moving 40 pixels left as specified in the ending position data-top-bottom="background-position: -40px 50%;". The content is this time fixed to 206px from the top of the slide and doesn’t move. It fades in when the #slide-3 is 106 pixel from the top of the viewport and stays at full opacity until the slide is 30% above the top of the viewport.
abc curtains rockinghamThen it fades out when 60% of the slide is out of the view.
ikea thermal curtain linings Note: Using the percentage instead of pixels is very handy especially if you don’t know how tall your sections will be – e.g. if you are using javascript to keep sections 100% height of your viewport on window resize.
ikea thermal curtain linings

Section height – 200% of the viewport, resized on page load This one is my favourite. Because it was made in the browser, by trying a few things. The background animation is similar to our first slide, so lets jump straight the curtain effect. Note that this section has additional class .homeSlideTall which give this section a double the height. The .curtain is basically a div with a background-color set to #000. It’s invisible (data-bottom-top) until the top of the #slide-4 reaches 106 pixels from the top of the viewport (data-106-top).
grommets in curtains spacing It’s height grows from 1% and becomes 100% when this slide is centered in the viewport (data-center). Remember that we’ve doubled the height of this slide? Now you know why. It gives us more room to show and fade out the .copy. The .copy fades in just after the curtain covers the whole screen and fades out before it reaches our header (data-106-top).

Section height – 300% of the viewport, resized on page load Finally lets have a look at the last section and congratulations if you’ve made it this far. .bcg is the beautiful sharp image of a waterfall in Sapa, Vietnam. On top of it is a blurred image .bcg2(with z-index: 1) which starts fading in when the top of #slide-5 is 33% above the top of the viewport (data--33p-top). It becomes fully visible when the section is 66% out of the view (data--66p-top). .bcg3 is the final screen which fades in between 300 and 100 pixels from the bottom of the page and it’s content .hsContent then fades in right at the end. If you want to create a parallax scrolling website that works and looks great, keep these points in mind: Let me know in the comments below what are your tricks or struggles when it comes to developing a parallax scrolling websites. I would love to hear your thoughts.Enter your email below and I’ll send it right to your inbox! Made to Measure Curtains and Blinds