global.js 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*全局自适应高度*/
  2. function autoFlashHeight(){
  3. var headerHeight = $(".header").height();
  4. var bottomContentHeight = $(".bottom-content").height();
  5. var toolsBar = $(".tools-bar").height();
  6. $(".content").height($(window).height()-headerHeight);
  7. $(".main-side").height($(window).height()-headerHeight-2);
  8. $(".fluid-content").height($(window).height()-headerHeight-1);
  9. $(".side-content").height($(window).height()-headerHeight );
  10. $(".poj-list").height($(window).height()-headerHeight);
  11. $(".form-list").height($(window).height()-headerHeight-50 );
  12. $(".main-data-top").height($(window).height()-headerHeight-toolsBar-bottomContentHeight-2);
  13. $(".main-data-top-fluid").height($(window).height()-headerHeight-bottomContentHeight-2);
  14. $(".main-data").height($(window).height()-headerHeight);
  15. $(".main-side .tab-content").height($(window).height()-headerHeight-38);
  16. $('#partialBody').height($(window).height()-headerHeight-toolsBar - 60);
  17. let partialWidth = $('#tablePartial').width();
  18. $('#tablePartial').find('th:eq(0)').width(partialWidth * 0.06);
  19. $('#tablePartial').find('th:eq(1)').width(partialWidth * 0.3);
  20. $('#tablePartial').find('th:eq(2)').width(partialWidth * 0.64);
  21. $('#partialBody').find('tr').find('td:eq(0)').width(partialWidth * 0.06);
  22. $('#partialBody').find('tr').find('td:eq(1)').width(partialWidth * 0.3);
  23. $('#partialBody').find('tr').find('td:eq(2)').width(partialWidth * 0.64);
  24. //说明
  25. $('#explanationShow').height($(window).height()-headerHeight-toolsBar-100);
  26. //计算规则
  27. $('#ruleTextShow').height($(window).height()-headerHeight-toolsBar-100);
  28. };
  29. $(window).resize(autoFlashHeight);
  30. /*全局自适应高度结束*/
  31. $(function(){
  32. /*侧滑*/
  33. $(".open-sidebar").click(function(){
  34. $(".slide-sidebar").animate({width:"800"}).addClass("open");
  35. });
  36. $("body").click(function(event){
  37. var e = event || window.event; //浏览器兼容性
  38. if(!$(event.target).is('a')) {
  39. var elem = event.target || e.srcElement;
  40. while (elem) { //循环判断至跟节点,防止点击的是div子元素
  41. if (elem.className == "open-sidebar" || elem.className == 'slide-sidebar open') {
  42. return false;
  43. }
  44. elem = elem.parentNode;
  45. }
  46. $(".slide-sidebar").animate({width:"0"}).removeClass("open")// 关闭处理
  47. }
  48. });
  49. /*侧滑*/
  50. /*工具提示*/
  51. $('*[data-toggle=tooltip]').mouseover(function() {
  52. $(this).tooltip('show');
  53. });
  54. /*工具提示*/
  55. });