hpSjlrGzxx.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. $(function(){
  2. var t1 = null;//这个设置为全局
  3. var myScroll;
  4. /*滚动区域事件*/
  5. myScroll = new IScroll(".gZdangan_iscroll",{
  6. scrollbars: true,
  7. fadeScrollbars:true,
  8. scrollbars: 'custom',
  9. shrinkScrollbars:'clip',
  10. });
  11. /*滚动区域的刷新事件*/
  12. setTimeout(function () {
  13. myScroll.refresh();
  14. }, 100);
  15. /* 图标切换*/
  16. $(".dropdownBtn").on("tap",function(e){
  17. if(e.preventDefault){
  18. e.preventDefault();
  19. }else{
  20. event.returnValue = false;
  21. }
  22. if(e.stopPropagation){
  23. e.stopPropagation();
  24. }else{
  25. event.cancelBubble = true;
  26. }
  27. //解决tap两次出发的方法(500是2次点击时间差,单位ms)
  28. if (t1 == null){
  29. t1 = new Date().getTime();
  30. }else{
  31. var t2 = new Date().getTime();
  32. if(t2 - t1 < 500){
  33. t1 = t2;
  34. return;
  35. }else{
  36. t1 = t2;
  37. }
  38. }
  39. $(this).children().toggleClass("dropup");
  40. $(this).parent().toggleClass("addColor");
  41. $(this).parent().next().slideToggle (500,function(){
  42. setTimeout(function(){
  43. myScroll.refresh();
  44. }, 100);
  45. });
  46. });
  47. //touchmove的阻止浏览器或者屏幕滚动默认事件
  48. document.addEventListener("touchmove", function (e) {
  49. e.preventDefault();
  50. }, false);
  51. haifmp.loadMobilePage("chartA", "getZzwdMain.htm?dweb=" + $("#dweb").val());
  52. });
  53. //返回事件
  54. function backUrl() {
  55. if ($("#fromtt").val() != 'zztt') {//来自档案
  56. haifmp.loadMobilePage("haifm", "hpSjlrDaIndex.htm?mcid=" + $("#mcid").val() + "&ztsl=" + $("#ztsl").val());
  57. } else {//来自淘汰
  58. haifmp.loadMobilePage("haifm", "hpSjlrZzttIndex.htm?mcid=" + $("#mcid").val());
  59. }
  60. }
  61. function edit() {
  62. haifmp.loadMobilePage("haifm", "hpSjlrGzdaAdd.htm?mcid=" + $("#mcid").val() + "&dweb=" + $("#dweb").val() + "&edit=" + "edit");
  63. }