標籤:
PFold.js是一款摺疊紙片外掛程式,支援定義摺疊紙牌數量、摺疊動畫效果、摺疊方向,而且還支援摺疊結束後回調方法。
線上執行個體
使用方法
- <div id="uc-container" class="uc-container">
- <div class="uc-initial-content">
- <span class="clickme">點擊我</span>
- </div>
- <div class="uc-final-content">
- <div class="scrollwrap">
- <h3>Dear Sucaihuo,</h3>
- <p>I just wanted to let you know that you left the garage door open and all the monkeys could get away! Great job! How often did I tell you <span>NOT</span> to forget to close it. On top of all that you also left the gate open and now they are literally in the wild! Anyway, just wated to say <span>THANKS</span> for that!</p><p class="signature">Yours, Barbara</p>
- </div>
- <span class="close">x</span>
- </div>
- </div>
複製
- var $container = $(‘#uc-container‘),
- pfold = $(‘#uc-container‘).pfold({
- easing: ‘ease-in-out‘,
- folds: 3,
- folddirection: [‘left‘, ‘bottom‘, ‘right‘]
- });
-
- $container.find(‘span.clickme‘).on(‘click‘, function() {
- pfold.unfold();
- }).end().find(‘span.close‘).on(‘click‘, function() {
- pfold.fold();
- });
複製參數詳解
| 參數 |
描述 |
預設值 |
| perspective |
透視度 |
1200 |
| speed |
開啟紙卡速度 |
450 |
| easing |
動畫效果 |
linear |
| folddelay |
摺疊延遲時間 |
0 |
| folds |
摺疊次數 |
2 |
| folddirection |
摺疊方向順序 |
[‘right‘,‘top‘] |
| overlays |
遮蓋物 |
true |
| centered |
是否置中 |
false |
| containerSpeedFactor |
[0 - 1] specify a different speed for the container‘s translation |
1 |
| containerEasing |
easing for the container transition this is only valid if centered is true |
linear |
| 方法Method |
| onEndFolding |
onEndFolding : function() { return false; } |
- |
| onEndUnfolding |
onEndUnfolding : function() { return false; } |
- |
下載
PFold.js 摺疊紙片