global.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*全局自适应高度*/
  2. function autoFlashHeight(){
  3. var headerHeight = $(".header").height();
  4. var bottomContentHeight = $(".bottom-content").height();
  5. $(".content").height($(window).height()-headerHeight);
  6. $(".main-side").height($(window).height()-headerHeight-2);
  7. $(".top-content").height($(window).height()-headerHeight-bottomContentHeight-1);
  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. };
  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. });