Turn.js Book page Turn effect

Source: Internet
Author: User

Today with Turn.js to do book page turn effect encountered problems:

Picture Path always error

It's been tuned for a day.

I use the thinkphp, the others do not know is not the same

Two places to change:

1. Background detection Address

Note the place: 1. Address to be completely

2.js data to be in JSON format

$more = M (' File ')->where (array (' id ' = $id))->find (); $more 1 = Json_decode ($more [' More '],true);  foreach ($more 1 as $k = + $v) {  /*weburl is the site domain name  savepath is the image storage address */$v [' path '] = C (' Weburl '). ' /'. $v [' Savepath ']; $type = End (Explode ('. ', $v [' name ']); if (' jpg ' = = $type) {      $more 2[] = $v;    }} $more [' more2 '] = $more 2; $more [' more3 '] = Json_encode ($more 2); $this->assign (' more ', $more);

2. Front-desk JS to form the required JSON data to the method to pass

< {$more. more3} > ;    var savepath = new Array ();    var I=1;    $.each (more, function (e,v) {        savepath[i] = V.path;        i++;    });
missing:function (event, pages) {    //Add pages aren ' t    in the magazine<  page S. length; i++) {    addPage (Pages[i], $ (this), Savepath);}    }

3.Magazine.js to change

function AddPage (page, book,data) function loadPage (page, pageelement,data) There are several places to change the image path Img.attr (' src ', data[page]); /img.attr (' src ', ' pages/' +  page + '. jpg ');

Turn.js Book page Turn effect

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.