Mam taki kod:
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <style type='text/css'> @import url(http://fonts.googleapis.com/css?family=Russo+One); body{ padding: 0; margin: 0; } #wrap{ width: 100%; height: 1000px; background: url('bg.jpg'); background-size: cover; background-attachment: fixed; } #title{ width: 400px; height: 100px; margin: 0 auto; position: relative; top: 50px; } p{ font-size: 50px; font-family: Russo One; } #head{ width: 100%; height: 80px; position: fixed; top: 0; background: #ddd; } #invisible{ width: 100%; height: 950px; } #visible{ width: 400px; height: 1000px; margin: 0 auto; } </style> </head> <body> <div id='wrap'> <div id='head'> </div> <div id='title'> </div> <div id='invisible'> </div> <div id='visible'> </div> </div> </body> </html>
I chodzi o to że jeśli przewinę stronę o jakieś 900 px to tło #head ma się zmienić.
Próbowałem z funkcją .scroll(), ale niestety nie chce mi wyjść.
Pozdrawiam, Przemek.