global.js 1.6 KB

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