Turn.js を使用して作業しているプロジェクトで、ちょっとした問題が発生しました。コンテンツが見つかるページへのクリック可能なリンクを含む「目次」を作成しようとしています。私がやったことは数回うまくいくように見えますが、その後はただ終了します。
HTML:
<div id="flipbook">
<div class="hard"><p>Turn.js</p></div>
<div class="hard"></div>
<div>
<div class="button-container">
<button data-page="4">Go To Page 1</button>
<button data-page="5">Go To Page 2</button>
<button data-page="6">Go To Page 3</button>
<button data-page="7">Go To Page 4</button>
<button data-page="8">Go To Page 5</button>
<button data-page="9">Go To Page 6</button>
<button data-page="10">Go To Page 7</button>
<button data-page="11">Go To Page 8</button>
</div>
</div>
<div><p>Page 1</p></div>
<div><p>Page 2</p></div>
<div><p>Page 3</p></div>
<div><p>Page 4</p></div>
<div><p>Page 5</p></div>
<div><p>Page 6</p></div>
<div><p>Page 7</p></div>
<div><p>Page 8</p></div>
<div class="hard"></div>
<div class="hard"></div>
</div>
<button class="reset" data-page="3">Reset</button>
JS:
$("#flipbook").turn({
width: 400,
height: 300,
autoCenter: true
});
$("button").click(function(){
$("#flipbook").turn("page", $(this).data('page'));
});
ここに jsfiddle があります: http://jsfiddle.net/ddcarr/fveoyv4o/1/
私のセットアップは基本的に同じです。本の要素の外に常に機能するリセットボタンがあります。これは、ポインターイベントまたは z-indexing に問題があると私は信じています。誰かが私を正しい方向に向けることができれば、私は本当に感謝しています。
ありがとう!