global.js 2.3 KB

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