global.js 2.2 KB

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