1

I am using Bootstrap 3.1 on a website for a client who wants parallax scrolling, but I have an issue with the coding behind the parallax scrolling, because I simply can't figure out why my coding works.

I have a piece of code used for parallax scrolling, and it works, and I simply cannot figure out why. The piece of code is as follows, but I do not have any jQuery rules that applies to the data-type or the data-speed.

<div class="bg-parallax" id="par-studying" data-type="background" data-speed="20">

</div><!--End of parallax-background-->

My CSS code for those rules is

.bg-parallax {
background: no-repeat fixed;
background-position: 50% 50%;

-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;

height: 300px;
margin: 0 auto;
width: 100%;
}

I suspect that it is because of the fixed background, but I am not sure.

1 Answer 1

2

You must be using some JavaScript code somewhere to do parallax, because that CSS alone won't do it.

Based on the data- attributes, I'm guessing that this is what you are using: A Simple Parallax Scrolling Technique That site explains the code.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.