I'm trying to have a simple parallax effect on a background image using Stellar.js...what am I doing wrong?
My HTML:
...
<div id="parallax" data-stellar-background-ratio="2">
<p>Content</p>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="js/jquery.stellar.min.js"></script>
<script>
$("#parallax").stellar();
</script>
</body>
</html>
CSS
#parallax {
background-image: url("../img/bg.jpg");
height: 500px;
}
我来晚了,但是无论如何,请尝试使用Stellar zip中附带的jquery,并将背景附件更改为fixed。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.