簡體   English   中英

恆星視差效果不起作用

[英]Stellar Parallax Effect not Working

我正在嘗試使用Stellar.js在背景圖像上產生簡單的視差效果...我在做什么錯?

我的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。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM