Select Different Div on JFlow Load
I am using JFlow for my content slider and would like to select one particular slide on page l开发者_如何学运维oad. It can be the 5th slide or the second one but I don't want to re-order the slides.
Any ideas? link text
You can achieve this, but need to change "jquery.flow.1.2.js" ti suit your requirement. Here is the updated file
For this existing defaults block with this one. Note last line with startSlideNumber variable
$.fn.jFlow.defaults = {
controller: ".jFlowControl", // must be class, use . sign
slideWrapper : "#jFlowSlide", // must be id, use # sign
selectedWrapper: "jFlowSelected", // just pure text, no sign
easing: "swing",
duration: 400,
width: "100%",
prev: ".jFlowPrev", // must be class, use . sign
next: ".jFlowNext", // must be class, use . sign
startSlideNumber:0
};
then change
var cur = 0; to
var cur = opts.startSlideNumber;
In your your main file, you can write, Here you can initialize "startSlideNumber" to your slide number [5th or second]. Remember 1st slide = 0
$(document).ready(function(){
$("#myController").jFlow({
slides: "#slides",
controller: ".jFlowControl", // must be class, use . sign
slideWrapper : "#jFlowSlide", // must be id, use # sign
selectedWrapper: "jFlowSelected", // just pure text, no sign
auto: true, //auto change slide, default true
width: "610px",
height: "235px",
duration: 400,
prev: ".jFlowPrev", // must be class, use . sign
next: ".jFlowNext", // must be class, use . sign
startSlideNumber:2
});
});
精彩评论