Slider Slider Use
One, add the slider
Second, complete the event processing in JS
Function
Appcan.slider ({ parameter})
selector:/* Selector */,
Hasindicator:true or False/* is there a position cue bar */,
Haslabel : TRUE or false/* is there a label text field */,
aspectratio:0 or!=0/* whether to control the aspect ratio, 0 is to use the control height, >0 uses the aspect ratio */,
index:0 or >0/* Default selection * /
Auto : +/* carousel time, in milliseconds per millisecond * /
Method:
Set (data)
Clickitem Events
Example 1:
1. Add a slider
<!-- Add a slider -
<div id= "Slider" class= "Slider" ></div>
2.js Code:
Var slider = appcan.slider ({ selector : ' #slider ', aspectratio:6/16, hasLabel:true, index:0, auto:2000 }); slider.set ([{ img : "Images/slider1.jpg", label: "" }, { img : "images/ Slider2.jpg ", label:" " }, { img : "Images/slider3.jpg", &nbSp;label: "&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;}]) Slider.on ("Clickitem", function (Index,data) {})
Clickitem Events triggering
in the Slider.on ("Clickitem", function (Index,data) {}) You can add event processing in the
Such as:
Slider.on ("Clickitem", Function (Index,data) { if (0 == index) { appcan.window.open (' page ', ' page.html ', 10); }else if (1 == index) { appcan.window.open (' Page2 ', ' page2.html ', &NBSP;10); }else if (2 == index) { Appcan.window.open (' page3 ', ' page3.html ', 10); }else{ alter ("error");nbsp; }})
This article is from the "Beyond the Horizon" blog, be sure to keep this source http://udbful.blog.51cto.com/10601869/1684946
Appcan Introductory Learning Picture Carousel and its event handling