global.js 1.3 KB

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