http://blog.youkuaiyun.com/z88xiaodong/article/details/48341325
mui('.mui-slider-item').on('tap', '.mui-slider-item a', function(e) {
var href = this.getAttribute('href');
console.log('当前轮播图片地址:'+href);
//打开跳转链接
mui.openWindow({ //目标页面
url:'lunbo.html',
id: 'lunbo.html',
extras:{
href:href
}
});
});
//页面跳转事件委托
mui('body').on('tap','a',function(){
window.top.location.href=this.href;
});
本文介绍如何使用MUI框架实现轮播图的点击跳转功能,通过为轮播图项添加tap事件监听器,并利用mui.openWindow方法实现页面跳转。同时,文中还展示了如何通过事件委托的方式统一处理页面内的链接点击事件。
1万+

被折叠的 条评论
为什么被折叠?



