global.js 1005 B

1234567891011121314151617181920212223242526272829303132
  1. function autoFlashHeight(){
  2. $(".wrapContent").height($(window).height()-48 );
  3. $(".mainContent").height($(window).height()-48 );
  4. $(".scollContent").height($(window).height()-130 );
  5. $(".slideContent").height($(window).height()-46 );
  6. };
  7. $(window).resize(autoFlashHeight);
  8. $(function(){
  9. /*侧滑*/
  10. $(".opensidebar").click(function(){
  11. $(".wrapSlide").animate({width:"800"}).addClass("open");
  12. });
  13. $("body").click(function(event){
  14. var e = event || window.event; //浏览器兼容性
  15. if(!$(event.target).is('a')) {
  16. var elem = event.target || e.srcElement;
  17. while (elem) { //循环判断至跟节点,防止点击的是div子元素
  18. if (elem.className == "opensidebar" || elem.className == 'wrapSlide open') {
  19. return false;
  20. }
  21. elem = elem.parentNode;
  22. }
  23. $(".wrapSlide").animate({width:"0"}).removeClass("open")// 关闭处理
  24. }
  25. });
  26. /*侧滑*/
  27. });