2017-07-14 16 views
0

我只是搞亂了FullPage.js擴展以查看它是否可以幫助我實現我想要的結果。基本上我想要一個div作爲所有部分的背景,在我的情況下,它不是我想要保留在背景中的視頻或圖像,但是三維動畫每次都會浪費資源來運行腳本。我已經嘗試過FullPage.js 1 div是所有部分的背景

<div id="fullpage"> 
    <!-- id="webgl" Three js script would be loaded here --> 
    <div class="section">Some section</div> 
    <div class="section">Some section</div> 
    <div class="section">Some section</div> 
</div> 

而且我想這個樣式的地方腳本加載了DIV

#webgl{ 
width: 100%; 
height: 100%; 
position: fixed; 
} 

到目前爲止,只有第1部分的內容將顯示在加載腳本所需但是當我滾動到第二部分,即使固定位置,腳本也不再可見。有沒有人有任何想法?

回答

0

如果您想使背景固定,您可以嘗試background-attachment屬性,添加以下內容。

background-attachment: fixed; 

,或者你試圖把你的固定內容了全頁元素:

<!-- id="webgl" Three js script would be loaded here --> 
<div id="fullpage"> 

    <div class="section">Some section</div> 
    <div class="section">Some section</div> 
    <div class="section">Some section</div> 
</div> 

,並設置區段屬性

background: transparent; 

也許你可以試試。

+0

把它放在div工作!它實際上是在文檔中指定的,我剛剛意識到這一點,謝謝大聲笑 – user3200451

0

也許你可以添加「overflow:scroll;」