|
本帖最后由 波斯大香蕉 于 2016-3-16 15:46 编辑
如图。
右边的删除键是要向左滑动才能出来,但是执行完了这个动作,右边的DIV有个点击事件,还会执行这个事件,就跳转到另一个页面了。
我已经用了event.stopPropagation();来阻止冒泡,但是还是不行,总是执行完滑动的动作,之后又执行了点击事件。这个应该怎么办?
谷歌浏览器就算是没有用event.stopPropagation();也不会有这种现象,只有手机会有这种现象。
相关代码如下:
// 滑动列表初始化
Model.prototype.list1AfterRender = function(event) {
new Swiper('.swiper-container', {
slidesPerView : "auto",// 设置每个div宽度
});
};
// 点击跳转到相关内容页面
Model.prototype.store_divClick = function(event) {
// event.preventDefault();
event.stopPropagation();
var id = $(event.currentTarget).attr("object_id");
var catid = $(event.currentTarget).attr("store_catid");
var modelid = $(event.currentTarget).attr("modelid");
var data = {
id : id,
catid : catid,
};
// console.log(modelid);
// console.log(data);
// 资讯
if (modelid === "1") {
justep.Shell.showPage("$UI/news/news_info/news_info.w", data);
}
// 图片
if (modelid === "3") {
justep.Shell.showPage("$UI/news/img_show/img_show.w", data);
}
// 视频
if (modelid === "11") {
justep.Shell.showPage("$UI/news/movie_talk/movie_talk.w", data);
}
// 商城
if (modelid === "13") {
justep.Shell.showPage("$UI/news/mall/goods_info/goods_info.w", data);
}
};
|
-
|