var timeout = undefined;
var startTime = 0;
var endTime = 0;
// web端适用
$(document).delegate('li', 'mousedown', function (event) {
startTime = new Date().getTime();
timeout = setTimeout(function() { // 长按
jqalert({
is_need_btn: false,
btn_text_arry: [
'编辑'
],
link_arry: [
'${ctx}/opport/opport/edit?id=' + $(this).attr('id')
]
});
}, 400);
});
$(document).delegate('li', 'mouseup', function (event) {
endTime = new Date().getTime();
clearTimeout(timeout);
if ((endTime - startTime) < 400) { // 单击
window.location.href = '${ctx}/opport/opport/detail?id=' + $(this).attr('id');
}
});
// phone端适用
$(document).delegate('li', 'touchstart', function (event) {
startTime = new Date().getTime();
timeout = setTimeout(function() { // 长按
jqalert({
is_need_btn: false,
btn_text_arry: [
'编辑'
],
link_arry: [
'${ctx}/opport/opport/edit?id=' + $(this).attr('id')
]
});
}, 400);
});
$(document).delegate('li', 'touchend', function (event) {
endTime = new Date().getTime();
clearTimeout(timeout);
if ((endTime - startTime) < 400) { // 单击
window.location.href = '${ctx}/opport/opport/detail?id=' + $(this).attr('id');
}
});