$('#default').microfiche();
$('#cyclic').microfiche({ cyclic: true });
$('#buttons').microfiche({ buttons: false });
$('#bullets').microfiche({ bullets: false });
$('#keyboard').microfiche({ keyboard: true });
$('#click').microfiche({ clickToAdvance: true });
Commands are passed to the microfiche method as options, and may be passed at any point.
In this example, the slideByPages(1)
command is performed immediately
after Microfiche has finished setting up.
$('#commands').microfiche({ slideByPages: 1 });
$('#commands').microfiche({ slideByPages: -1 })
$('#commands').microfiche({ slideByPages: 1 })
$('#commands').microfiche({ slideToPoint: 0 })
$('#commands').microfiche({ jumpToPoint: 0 })
$('#commands').microfiche({ jumpToPage: 2 })
Microfiche emits the following events:
'microfiche:willMove'
'microfiche:didMove'
You can listen for them in the usual way:
$('#events').microfiche().on('microfiche:willMove microfiche:didMove', function(event) { $('#events-console').html(event.type); });
Event received: -
Microfiche has some useful methods that return values, and so cannot
be used through the aforementioned jQuery style syntax. The microfiche
object itself is available via jQuery’ data
method.
$('.my-element').data('microfiche');
var m = $('#methods').microfiche().data('microfiche'); m.currentPageIndex() // returns 0-index of the current page m.totalPageCount() // returns the number of pages as an integer m.min() // returns the minimum (left-most) position m.max() // returns the maximum (right-most) position
$('#autoplay').microfiche({ cyclic: true, autoplay: 3 })
Copyright (c) 2012 With Associates
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.