资源说明:jQuery Plugin - display web content in a flipbook
# jQuery Booklet Plugin Booklet is a jQuery tool for displaying content on the web in a flipbook layout. It was built using the jQuery library. Licensed under both MIT and GPL licenses. For detailed documentation and information, visit http://www.builtbywill.com/booklet/. Below is some basic information to get you started. ## Installation To install jQuery Booklet into your webpage, first include jQuery, jQuery UI (optional), jQuery Easing and the booklet CSS and JS files. ``` html // CSS ``` ``` html // jQuery // jQuery UI (optional) // Booklet ``` The target that will become your booklet should simply be a container with multiple children. All first level children will become pages inside of the booklet. ``` html``` Once you have the files included and the structure created, you can initialize the booklet. ``` javascript $(function() { //single book $('#mybook').booklet(); //multiple books with ID's $('#mybook1, #mybook2').booklet(); //multiple books with a class $('.mycustombooks').booklet(); }); ``` ## Documentation ### Options Options can be set either with an init object, or afterwards with a setter function. Also, you can get the value of an option as well. To see all available options, see the [Documentation](http://www.builtbywill.com/booklet/#/documentation) ``` javascript //init $(".selector").booklet({ width: 500 }); //getter var width = $(".selector").booklet("option", "width"); //setter $(".selector").booklet("option", "width", 600); ``` ## Events The following events are triggered when using a booklet. * bookletcreate * bookletstart, bookletchange * bookletadd, bookletremove Each event returns a data object which contains data related to the event. Common to all events are: * data.options - the current booklet options at time of the event (read-only) * data.index - zero-based index of the currently visible page spread Only available for bookletcreate, bookletstart and bookletchange events: * data.pages - an array of elements, the two currently visible pages Only available for bookletadd and bookletremove events: * data.page - element, the page that was either just added or just removed You can bind your callbacks to events either at init, or using the event type. To see all available events, see the [Documentation](http://www.builtbywill.com/booklet/#/documentation) ``` javascript //init $(".selector").booklet({ create: function(event, data) { ... } }); //event type $(".selector").bind("bookletcreate", function(event, data) { ... }); ``` ## Methods The methods available for each booklet can be called on one or more booklets at the same time. Methods which return a value, such as an option, when called on more than one selector will return an array of values. Otherwise, the chainability of the elements will be maintained. ``` javascript //destroys the booklet $(".selector").booklet("destroy"); // get a single returned option var val = $("#selector").booklet("option", "width"); // get an array of returned options (for multiple booklets) var val = $(".selector, .selector2").booklet("option", "width"); ``` To see all available methods, see the [Documentation](http://www.builtbywill.com/booklet/#/documentation) ## Style Once the booklet is created, the basic generated structure and CSS will appear below. If more customization is desired, all generated classes are visible in the current jQuery Booklet stylesheet. ``` htmlYay, Page 1!
Yay, Page 2!
Yay, Page 3!
Yay, Page 4!
```...............
本源码包内暂不包含可直接显示的源代码文件,请下载源码包。