0

I have this whole section here:

<section id="design-centre">
    <section id="design-centre-cover">
        <div class="container">
            <div class="row">
                <div class="cover-left">
                    <h1>Our Designs Make Luxury More Affordable</h1>
                </div>
            </div>
        </div>
    </section>
 </section>

And here is the CSS:

 section#design-centre {
    position: relative;
 }

 background: url(../images/design-center-cover.jpg) center top no-repeat;
    height: 800px;
    background-attachment: fixed;
 }

What I am trying to do is the following:

Have the image scroll when I the user scrolls, here is an example on what I am looking for:

http://www.hush.ca/hush-design-main/#hush-design

I tried using background-attachment: fixed; but that didn't work at all

user979331
  • 11,039
  • 73
  • 223
  • 418

1 Answers1

0

At the moment, it doesn't seem to be possible without JavaScript. Try some tutorials for example code. The main premise is using either the vanilla JavaScript window.onscroll or the jQuery $(window).scroll() event handlers to detect scrolling of the main page, and reposition the background accordingly.

Also, next time you might want to search SO first for duplicate/similar questions before asking your own question.

Community
  • 1
  • 1
andrewgu
  • 1,562
  • 14
  • 23