2013-12-21 19 views
0

我想在impress.js中更改我的幻燈片順序。但我無法通過只添加一個 這樣做有沒有辦法做到這一點?如何更改印象js中的幻燈片順序

我的代碼看起來像事先下面

<!--slide 1--> 
<div id="title" class="step" data-x="0" data-y="0" data-scale="4"> 
    <span class="try">How to perform</span> <br/> 
    <h1>A Soft Handover</h1> 
    <span class="footnote">in Mobile Networks</span> 
</div> 

<!--slide 2--> 
<div id="its" class="step" data-x="850" data-y="3000" data-rotate="90" data-scale="5"> 
    <h2 style="font-size:72px">What is a soft handover?</h2> 
    <p style="font-size:40px;text-align:justify">When a mobile station moves from one base station's coverage to another's during an existing call, the base stations transfer services between each other to keep the call alive. 
    </p> 
</div> 

<!--slide 3--> 
<div id="its" class="step" data-x="-3500" data-y="4000" data-rotate="180" data-scale="6"> 
    <h2 style="font-size:72px">What is a?</h2> 
    <p style="font-size:40px;text-align:justify">When a mobile station moves from one base station's coverage to another's during an existing call, the base stations transfer services between each other to keep the call alive. 
    </p> 
</div> 

感謝。

+0

變化數據-X,數據Y和數據規模在適當的分區。我試過這個。它的工作。但是,你必須耐心改變這些事情..讓我知道如果它的工作或任何其他問題... – Karuppiah

+1

例如:<! - slide 1 - >

<! - slide 3 - >
。你應該首先制定一個計劃,哪個幻燈片是第一個,哪個是第二個等。,改變這些東西來改變你的滑塊順序... – Karuppiah

回答

1

impress.js幻燈片按照「步驟」div出現在html中的順序排序。 所以,你只需要移動它們在你的html文件中重新排序。

此初始順序允許您執行impress()。goto(index)其中索引爲0的第一張幻燈片,1爲第二張等等。

如果您要動態更改JavaScript訪問這些幻燈片的順序,您可以爲所需索引調用impress()。goto(index),如果您使用javascript文件控制幻燈片之間的轉換。

編輯:我意識到這個問題,幾乎是一歲,但對於其他人使用impress.js,你會發現這個鏈接有用 https://gist.github.com/lavallee/2340157