You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

tooltips.js 2.7 KiB

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. var msgdsq;
  2. //错误时:提示调用方法
  3. function show_err_msg(msg){
  4. $('.msg_bg').html('');
  5. clearTimeout(msgdsq);
  6. $('body').append('<div class="sub_err" style="position:absolute;top:60px;left:0;width:500px;z-index:999999;"></div>');
  7. var errhtml ='<div class="bac" style="padding:8px 0px;border:1px solid #ff0000;width:100%;margin:0 auto;background-color:#fff;color:#B90802;border:3px #ff0000 solid;text-align:center;font-size:16px;font-family:微软雅黑;"><img style="margin-right:10px;" src="/Content/images/OnlineRegistrate/error.png">';
  8. var errhtmlfoot='</div>';
  9. $('.msg_bg').height($(document).height());
  10. $('.sub_err').html(errhtml+msg+errhtmlfoot);
  11. var left=($(document).width()-500)/2;
  12. $('.sub_err').css({'left':left+'px'});
  13. var scroll_height=$(document).scrollTop();
  14. $('.sub_err').animate({'top': scroll_height+120},300);
  15. msgdsq=setTimeout(function(){
  16. $('.sub_err').animate({'top': scroll_height+80},300);
  17. setTimeout(function(){
  18. $('.msg_bg').remove();
  19. $('.sub_err').remove();
  20. },300);
  21. }, "1000");
  22. }
  23. //正确时:提示调用方法
  24. function show_msg(msg,url){
  25. $('.msg_bg').html('');
  26. clearTimeout(msgdsq);
  27. $('body').append('<div class="sub_err" style="position:absolute;top:60px;left:0;width:500px;z-index:999999;"></div>');
  28. var htmltop ='<div class="bac" style="padding:8px 0px;border:1px solid #090;width:100%;margin:0 auto;background-color:#FFF2F8;color:#090;border:3px #090 solid;;text-align:center;font-size:16px;"><img style="margin-right:10px;" src="/Content/images/OnlineRegistrate/loading.gif">';
  29. var htmlfoot='</div>';
  30. $('.msg_bg').height($(document).height());
  31. var left=($(document).width()-500)/2;
  32. $('.sub_err').css({'left':left+'px'});
  33. $('.sub_err').html(htmltop+msg+htmlfoot);
  34. var scroll_height=$(document).scrollTop();
  35. $('.sub_err').animate({'top': scroll_height+120},500);
  36. msgdsq=setTimeout(function(){
  37. $('.sub_err').animate({'top': scroll_height+80},500);
  38. setTimeout(function(){
  39. $('.msg_bg').remove();
  40. $('.sub_err').remove();
  41. if(url!='')
  42. {
  43. location.href='index.html';
  44. }
  45. },800);
  46. }, "1200");
  47. }
  48. //显示加载动画
  49. function show_loading()
  50. {
  51. var str='<div class="msg_bg" style="background:#000;opacity:0.5;filter:alpha(opacity=50);z-index:99998;width:100%;position:absolute;left:0;top:0"></div>';
  52. str +='<div class="msg_bg" style="z-index:99999;width:100%;position:absolute;left:0;top:0;text-align:center;"><img src="/Content/images/OnlineRegistrate/loading.gif" alt="" class="loading"></div>'
  53. $('body').append(str);
  54. var scroll_height=$(document).scrollTop();
  55. $('.msg_bg').height($(document).height());
  56. $('.loading').css('margin-top',scroll_height+240);
  57. }