1、参考在线资料:
引用
https://github.com/BE-FE/iSlider/blob/master/README_Chinese.md
2、demo实例:
var platform = window.Android || window;
function showFun(str1,str2,hData){
var sData = [
{
'content' : str1
},
{
'content' : str2
}
];
var islider1 = new iSlider({
data: sData,
type:'dom',
dom: document.getElementById("animationId"),
duration: 2000,
animateType: 'depth',
isAutoplay: false,
isLooping: false,
plugins: ['dot'],
onSlideChanged:function(number){
//卡片切换
},
onRenderComplete:function(number){
closeLoadingEffectFunction();
/*避免点击一次,触发2次调用情况*/
if(0==number){
/*0:第一张卡片*/
if(1==$("#aId").length){
document.querySelector("#hrefId").addEventListener("touchstart",function(){
platform.supplementInfo();
},false);
}
if(1==$("#bId").length){
document.querySelector("#hrefId3").addEventListener("touchstart",function(){
if(true){
doJumpFun();
}else{
platform.initOverdueDetail();
}
},false);
}
}else if(1==number){
//1:第二张卡片
}
}
});
}
<script src="./invlkejs/zepto.min.js"></script>
<script src="./invlkejs/iSlider.js"></script>
<script src="./invlkejs/dot.js"></script>
<script src="./invlkejs/iSlider.animate.js" ></script>