global.js 1.8 KB

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