global.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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").height($(window).height()-headerHeight);
  14. $(".main-side .tab-content").height($(window).height()-headerHeight-38);
  15. };
  16. $(window).resize(autoFlashHeight);
  17. /*全局自适应高度结束*/
  18. $(function(){
  19. /*侧滑*/
  20. $(".open-sidebar").click(function(){
  21. $(".slide-sidebar").animate({width:"800"}).addClass("open");
  22. });
  23. $("body").click(function(event){
  24. var e = event || window.event; //浏览器兼容性
  25. if(!$(event.target).is('a')) {
  26. var elem = event.target || e.srcElement;
  27. while (elem) { //循环判断至跟节点,防止点击的是div子元素
  28. if (elem.className == "open-sidebar" || elem.className == 'slide-sidebar open') {
  29. return false;
  30. }
  31. elem = elem.parentNode;
  32. }
  33. $(".slide-sidebar").animate({width:"0"}).removeClass("open")// 关闭处理
  34. }
  35. });
  36. /*侧滑*/
  37. /*工具提示*/
  38. $('*[data-toggle=tooltip]').mouseover(function() {
  39. $(this).tooltip('show');
  40. });
  41. /*工具提示*/
  42. });