battle.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. (function($){
  2. $(function(){
  3. /**
  4. * [被ban英雄下拉菜单]
  5. * @return {[type]} [description]
  6. */
  7. $("body").delegate('.user-info', 'mouseenter', function(event) {
  8. $('.user-img').show();
  9. event.preventDefault();
  10. });
  11. $("body").delegate( '.user-info', 'mouseleave', function(event) {
  12. $('.user-img').hide();
  13. event.preventDefault();
  14. });
  15. /*保证当前浮层置于最前*/
  16. $("body").delegate( '.team-name', 'mouseenter', function(event) {
  17. $(this).addClass('team-name--current');
  18. event.preventDefault();
  19. });
  20. $("body").delegate( '.team-name', 'mouseleave', function(event) {
  21. $(this).removeClass('team-name--current');
  22. });
  23. /*出装数据切换代码*/
  24. $("body").delegate('.sel-tab-link a','click', function(event) {
  25. var ocass = $(this).data('type');
  26. if( ocass == "early-data" ){
  27. $(".zj-table .col4").addClass('datalist');
  28. }
  29. else{
  30. $(".zj-table .col4").removeClass('datalist');
  31. }
  32. $('.sel-tab-link a').removeClass('link-on');
  33. $(this).addClass('link-on');
  34. $('.' + ocass).show().siblings('ul').hide();
  35. event.preventDefault();
  36. });
  37. /*隐藏显示装备栏目一件应用按钮*/
  38. $("body").delegate('.col4','mouseenter', function(event) {
  39. $(this).find(".link").css("visibility","visible");
  40. event.preventDefault();
  41. });
  42. $("body").delegate('.col4', 'mouseleave', function(event) {
  43. $(this).find(".link").css("visibility","hidden");
  44. event.preventDefault();
  45. });
  46. })
  47. /**
  48. * [tipsWin 盒子对象]
  49. * @type {[type]}
  50. */
  51. window.tipsWin = {};
  52. tipsWin.tooltips = {};/*浮层对象*/
  53. /**
  54. * [html 填写弹窗内mod-tips-content代码]
  55. * @param {[type]} str [代码结构字符串]
  56. * @return {[type]} [description]
  57. */
  58. tipsWin.tooltips.html = function(str){
  59. $( '#mod-tips-s1 .mod-tips-content' ).html(str);
  60. }
  61. /*关闭浮层*/
  62. tipsWin.tooltips.close = function(){
  63. tipsWin.tooltips.status = 0 ;
  64. $( '#mod-tips-s1' ).hide();
  65. }
  66. /**
  67. * [init 浮层初始化]
  68. * @return {[type]} [description]
  69. */
  70. tipsWin.tooltips.init = function(){
  71. if( tipsWin.tooltips.initSign == 1 ){
  72. return;
  73. }
  74. tipsWin.tooltips.initSign = 1 ;
  75. var layerHover = false;
  76. $("body").delegate('.zj-table .avatar', 'mouseenter', function(event) {
  77. var that= $(this);
  78. clearTimeout(window.toolTipTimer);
  79. clearTimeout(window.toolTipoutTimer);
  80. toolTipTimer = setTimeout(function(){
  81. tipsWin.tooltips.open(that);
  82. },150)
  83. });
  84. $("body").delegate('.zj-table .avatar', 'mouseleave', function(event) {
  85. event.preventDefault();
  86. clearTimeout(window.toolTipTimer);
  87. clearTimeout(window.toolTipoutTimer);
  88. toolTipoutTimer = setTimeout(function() {
  89. if(!layerHover) tipsWin.tooltips.close();
  90. }, 200);
  91. $("body").delegate('#mod-tips-s1', 'mouseenter', function(event) {
  92. event.preventDefault();
  93. layerHover = true;
  94. });
  95. $("body").delegate('#mod-tips-s1', 'mouseleave', function(event) {
  96. event.preventDefault();
  97. layerHover = false;
  98. clearTimeout(window.toolTipoutTimer);
  99. toolTipoutTimer = setTimeout(function() {
  100. tipsWin.tooltips.close();
  101. }, 200);
  102. });
  103. });
  104. }
  105. })(jQuery)