global.js 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*全局自适应高度*/
  2. function autoFlashHeight(){
  3. var headerHeight = $(".header").height();
  4. var toolsbarHeight = $(".toolsbar").height();
  5. var ftoolsbarHeight = $(".toolsbar-f").height();
  6. var bottomContentHeight = $(".bottom-content").height();
  7. var toolsBarHeightQ = $(".tools-bar-height-q").height();
  8. var toolsBarHeightD = $(".tools-bar-height-d").height();
  9. var toolsBarHeightZ = $(".tools-bar-height-z").height();
  10. var toolsBarHeightY = $(".tools-bar-height-y").height();
  11. $(".main-data-side-q").height($(window).height()-headerHeight-toolsbarHeight-toolsBarHeightQ-302);
  12. $(".main-data-side-d").height($(window).height()-headerHeight-toolsbarHeight-toolsBarHeightD-302);
  13. $(".main-data-side-m").height($(window).height()-headerHeight-toolsbarHeight-toolsBarHeightD-382);
  14. $(".main-data-side-y").height($(window).height()-headerHeight-toolsbarHeight-toolsBarHeightY-302);
  15. $(".main-data-side-z").height($(window).height()-headerHeight-toolsbarHeight-toolsBarHeightZ-2);
  16. $(".main-data-side-x").height($(window).height()-headerHeight-toolsbarHeight-toolsBarHeightY-2);
  17. $(".main-data-top").height($(window).height()-headerHeight-toolsbarHeight-bottomContentHeight-1);
  18. $(".main-data-full").height($(window).height()-headerHeight-toolsbarHeight-1);
  19. $(".main-data-full-fl").height($(window).height()-headerHeight-toolsbarHeight-37);
  20. $(".main-data-not").height($(window).height()-headerHeight-1);
  21. $(".main-data-side-search").height($(window).height()-headerHeight-toolsbarHeight-81);
  22. $(".side-content").height($(window).height()-headerHeight );
  23. $(".poj-list").height($(window).height()-headerHeight-toolsbarHeight);
  24. $(".form-view").height($(window).height()-headerHeight-ftoolsbarHeight);
  25. $(".form-list").height($(window).height()-headerHeight-50 );
  26. };
  27. $(window).resize(autoFlashHeight);
  28. /*全局自适应高度结束*/
  29. $(function(){
  30. /*侧滑*/
  31. $(".open-sidebar").click(function(){
  32. $(".slide-sidebar").animate({width:"800"}).addClass("open");
  33. });
  34. $("body").click(function(event){
  35. var e = event || window.event; //浏览器兼容性
  36. if(!$(event.target).is('a')) {
  37. var elem = event.target || e.srcElement;
  38. while (elem) { //循环判断至跟节点,防止点击的是div子元素
  39. if (elem.className == "open-sidebar" || elem.className == 'slide-sidebar open') {
  40. return false;
  41. }
  42. elem = elem.parentNode;
  43. }
  44. $(".slide-sidebar").animate({width:"0"}).removeClass("open")// 关闭处理
  45. }
  46. });
  47. /*侧滑*/
  48. /*工具提示*/
  49. $(function () {
  50. $('[data-toggle="tooltip"]').tooltip();
  51. $('[data-toggle="popover"]').popover();
  52. $('[data-submenu]').submenupicker();
  53. });
  54. });