global.js 2.3 KB

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