global.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. };
  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. $('*[data-toggle=tooltip]').mouseover(function() {
  40. $(this).tooltip('show');
  41. });
  42. /*工具提示*/
  43. });