0

我正在尝试使用 turn.js 在翻转时传递多个参数。当前选项仅对 pageNumber 进行了规定,即。

代替

function addPage (page, book) {
    //Check if the page is not in the book
    if ( ! book. turn( 'hasPage' , page)) {
        // Create an element for this page
        var element = $ ( '<div />' ). html ( 'Loading…' );
        // Add the page
        book.turn( 'addPage' , element, page);
        // Get the data for this page
        $.ajax ({url : "app?method=get-page-content&page=" + page)
            .done( function (data) { element. html (data); });
    }
}

我想

function addPage (page, book) {
    // Check if the page is not in the book
    if ( ! book. turn( 'hasPage' , page)) {
        // Create an element for this page
        var element = $ ( '<div />' ). html ( 'Loading…' );
        // Add the page
        book.turn( 'addPage' , element, page, chapter);
        // Get the data for this page
        $.ajax ({url : "app?method=get-page-content&page="+ 
page+ "&currentChapter" + chapter)
            .done( function (data) { element. html (data); });
    }
}

这样我就可以确定要服务的章节中的页面。

示例代码将不胜感激。

4

0 回答 0