global.js 1.9 KB

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