global.js 4.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. function autoFlashHeight(){
  2. var infoHeight = $(".contactInfo").height();
  3. var cateHeight = $(".contactCate").height();
  4. var lockHeight = $(".lockCate").height();
  5. $(".autoHeight").height($(window).height());
  6. $(".autoHeight105").height($(window).height()-lockHeight-15);
  7. $(".autoHeight110").height($(window).height()-140);
  8. $(".autoHeight115").height($(window).height()-45);
  9. $(".autoHeight120").height($(window).height()-cateHeight-55);
  10. $(".autoHeightT").height($(window).height()-infoHeight-20);
  11. $(".autoHeightT2").height($(window).height()-infoHeight-60);
  12. };
  13. $(window).resize(autoFlashHeight);
  14. $(function(){
  15. $(".zhzdFir").click(function () {
  16. $(this).toggleClass("now").siblings(".zhzdMenu").slideToggle("fast")
  17. });
  18. $(".amInput").children("label").children("input:checkbox").click(function(){
  19. if($(this).is(":checked")) {
  20. // 当前未选中
  21. $(".amInput").find("input:checked").removeAttr("checked");
  22. $(this).attr("checked", "checked");
  23. }
  24. });
  25. $(".pmInput").children("label").children("input:checkbox").click(function(){
  26. if($(this).is(":checked")) {
  27. // 当前未选中
  28. $(".pmInput").find("input:checked").removeAttr("checked");
  29. $(this).attr("checked", "checked");
  30. }
  31. });
  32. })
  33. /**
  34. * Bootstrap.js by @fat & @mdo
  35. * plugins: bootstrap-modal.js
  36. * Copyright 2012 Twitter, Inc.
  37. * http://www.apache.org/licenses/LICENSE-2.0.txt
  38. */
  39. !function(a){var b=function(b,c){this.options=c,this.$element=a(b).delegate('[data-dismiss="modal"]',"click.dismiss.modal",a.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};b.prototype={constructor:b,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var b=this,c=a.Event("show");this.$element.trigger(c);if(this.isShown||c.isDefaultPrevented())return;this.isShown=!0,this.escape(),this.backdrop(function(){var c=a.support.transition&&b.$element.hasClass("fade");b.$element.parent().length||b.$element.appendTo(document.body),b.$element.show(),c&&b.$element[0].offsetWidth,b.$element.addClass("in").attr("aria-hidden",!1),b.enforceFocus(),c?b.$element.one(a.support.transition.end,function(){b.$element.focus().trigger("shown")}):b.$element.focus().trigger("shown")})},hide:function(b){b&&b.preventDefault();var c=this;b=a.Event("hide"),this.$element.trigger(b);if(!this.isShown||b.isDefaultPrevented())return;this.isShown=!1,this.escape(),a(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),a.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal()},enforceFocus:function(){var b=this;a(document).on("focusin.modal",function(a){b.$element[0]!==a.target&&!b.$element.has(a.target).length&&b.$element.focus()})},escape:function(){var a=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(b){b.which==27&&a.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var b=this,c=setTimeout(function(){b.$element.off(a.support.transition.end),b.hideModal()},500);this.$element.one(a.support.transition.end,function(){clearTimeout(c),b.hideModal()})},hideModal:function(){var a=this;this.$element.hide(),this.backdrop(function(){a.removeBackdrop(),a.$element.trigger("hidden")})},removeBackdrop:function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},backdrop:function(b){var c=this,d=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var e=a.support.transition&&d;this.$backdrop=a('<div class="modal-backdrop '+d+'" />').appendTo(document.body),this.$backdrop.click(this.options.backdrop=="static"?a.proxy(this.$element[0].focus,this.$element[0]):a.proxy(this.hide,this)),e&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in");if(!b)return;e?this.$backdrop.one(a.support.transition.end,b):b()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(a.support.transition.end,b):b()):b&&b()}};var c=a.fn.modal;a.fn.modal=function(c){return this.each(function(){var d=a(this),e=d.data("modal"),f=a.extend({},a.fn.modal.defaults,d.data(),typeof c=="object"&&c);e||d.data("modal",e=new b(this,f)),typeof c=="string"?e[c]():f.show&&e.show()})},a.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},a.fn.modal.Constructor=b,a.fn.modal.noConflict=function(){return a.fn.modal=c,this},a(document).on("click.modal.data-api",'[data-toggle="modal"]',function(b){var c=a(this),d=c.attr("href"),e=a(c.attr("data-target")||d&&d.replace(/.*(?=#[^\s]+$)/,"")),f=e.data("modal")?"toggle":a.extend({remote:!/#/.test(d)&&d},e.data(),c.data());b.preventDefault(),e.modal(f).one("hide",function(){c.focus()})})}(window.jQuery)