实例化
var myScroll = new IScroll('div', {scrollX: true, scrollY: false, click: true, PRobeType: 3});//横向滑动myScroll.scrollToElement('.active', true, true)//active自动滚动到中间myScroll.on('scroll', function () {//滚动事件 if (Math.ceil(this.x) === myScroll.maxScrollX) { //Do something } else if (Math.floor(this.x) === 0) { //Do something } else { //Do something }});$("ul").width(($("li").length ) * ($("ul").find("li:nth-child(2)").outerWidth(true) ));//横向盒子的宽度(ul)新闻热点
疑难解答