$(function(){ var t1 = null;//这个设置为全局 /* 滚轮 */ var myScroll = new IScroll(".gZdangan_iscroll",{ scrollbars: true, fadeScrollbars:true, scrollbars: 'custom', shrinkScrollbars:'clip', }); setTimeout(function () { myScroll.refresh(); }, 100); /* 图标切换*/ $(".dropdownBtn").on("tap",function(e){ if(e.preventDefault){ e.preventDefault(); }else{ event.returnValue = false; } if(e.stopPropagation){ e.stopPropagation(); }else{ event.cancelBubble = true; } //解决tap两次出发的方法(500是2次点击时间差,单位ms) if (t1 == null){ t1 = new Date().getTime(); }else{ var t2 = new Date().getTime(); if(t2 - t1 < 500){ t1 = t2; return; }else{ t1 = t2; } } $(this).children().toggleClass("dropup"); $(this).parent().toggleClass("addColor"); $(this).parent().next().slideToggle (500,function(){ setTimeout(function(){ myScroll.refresh(); }, 100); }); }); //touchmove的阻止浏览器或者屏幕滚动默认事件 document.addEventListener("touchmove", function (e) { e.preventDefault(); }, false); haifmp.loadMobilePage("chartA", "getZzwdMain.htm?dweb=" + $("#dweb").val()); }); //返回事件 function backUrl() { if ($("#fromtt").val() != 'zztt') {//来自档案 haifm.loadMobilePage("haifm", "hpSjlrMzDaIndex.htm?mcid=" + $("#mcid").val() + "&ztsl=" + $("#ztsl").val()); } else {//来自淘汰 haifm.loadMobilePage("haifm", "hpSjlrZzttIndex.htm?mcid=" + $("#mcid").val()); } } function edit() { haifm.loadMobilePage("haifm", "hpSjlrMzdaAdd.htm?mcid=" + $("#mcid").val() + "&dweb=" + $("#dweb").val() + "&ebh=" + $("#ebh").val()+ "&edit=" + "edit"); }