global.js 1.6 KB

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