By : vp76 Published On Thursday, December 15, 2011, 14:06 In JavaScript
This item represents a new vision of a slideshow, offered as a jQuery plugin.
Some of possible uses :
$(document).simplePresentation({
autoplay: boolean,
loop: boolean,
intervalTime: integer,
preloading: boolean,
transitionFct: function
});
var transitionFunction = function(elt, source, transitionTime) {
Transition.opacity(elt, source, transitionTime);
};
$(document).simplePresentation({
autoplay: false,
loop: false,
intervalTime: 2000,
preloading: false,
transitionFct: transitionFunction
});
var transitionFunction = function(elt, source, transitionTime) {
elt.css("opacity", "0");
// If we're going to the next page
if (source == "RIGHT") {
elt.css("marginLeft", "100%");
elt.animate({
"opacity": 1,
"marginLeft": "0px"
}, transitionTime);
} else {
elt.css("marginRight", "100%");
elt.animate({
"opacity": 1,
"marginRight": "0px"
}, transitionTime);
}
};
$presentation = $(document).simplePresentation({
autoplay: false,
loop: false,
intervalTime: 4000,
preloading: true,
transitionFct: transitionFunction
});
<div id="container">
<div id="page1">
...
</div>
<div id="page2">
...
</div>
</div>
Each div with id=”pageX” represent a page.