1// JavaScript Document 2$(function(){ 3 4 //IE9 å ¼å®¹placdholder屿§ 5 function placeholderSupport() { 6 return 'placeholder' in document.createElement('input'); 7 } 8 if(!placeholderSupport()){ // 夿æµè§å¨æ¯å¦æ¯æ placeholder 9 $("[placeholder]").each(function(){ 10 var _this = $(this); 11 // console.log($(this).height()); 12 var inputHeight = parseInt(parseInt($(this).height()-2)-14)/2; 13 var inputHeight = parseInt(parseInt(parseInt($(this).height()-2)/2)-7)+'px'; 14 _this.parent().css({"position": "relative"}); 15 var left = _this.position().left+parseInt(_this.css("padding-left"))+parseInt(_this.css("margin-left"))+"px"; 16 var top = parseInt(_this.css("padding-top"));//+parseInt(_this.css("margin-top"))+"px"; 17 var top = parseInt(_this.css("padding-top"));//+parseInt(_this.css("margin-top"))+"px"; 18 _this.after('<span class="placeholder" data-type="placeholder" style="position: absolute;font-size:14px; top: '+ inputHeight +'; left: ' + left + '">' + _this.attr("placeholder") + '</span>'); 19 //_this.after('<span class="placeholder" data-type="placeholder" style="position: absolute; top: 0px; left: ' + left + '">' + _this.attr("placeholder") + '</span>'); 20 if(_this.val() != ""){ 21 _this.parent().find("span.placeholder").hide(); 22 } 23 else{ 24 _this.parent().find("span.placeholder").show(); 25 } 26 }).on("focus", function(){ 27 $(this).parent().find("span.placeholder").hide(); 28 }).on("blur", function(){ 29 var _this = $(this); 30 if(_this.val() != ""){ 31 _this.parent().find("span.placeholder").hide(); 32 } 33 else{ 34 _this.parent().find("span.placeholder").show(); 35 } 36 }); 37 // ç¹å»è¡¨ç¤ºplaceholderçæ ç¾ç¸å½äºè§¦åinput 38 $("span.placeholder").on("click", function(){ 39 $(this).hide(); 40 $(this).siblings("[placeholder]").trigger("click"); 41 $(this).siblings("[placeholder]").trigger("focus"); 42 }); 43 } 44 45 /*äºç»´ç */ 46 $("header .right .ewm").click(function(){ 47 $("header .right .ewm .ewm_tc").fadeToggle(); 48 $("header .right .ewm .ewm_tc").toggleClass("on"); 49 $("header .right .lan .yuyan").fadeOut(); 50 $("header .right .lan .yuyan").removeClass("on"); 51 }); 52 $("header .right .lan").click(function(){ 53 $("header .right .lan .yuyan").fadeToggle(); 54 $("header .right .lan .yuyan").toggleClass("on"); 55 $("header .right .ewm .ewm_tc").fadeOut(); 56 $("header .right .ewm .ewm_tc").removeClass("on"); 57 }); 58 59 60 61 $("header").addClass("on"); 62 $(".left_bar").addClass("on"); 63 $(".right_bar").addClass("on"); 64 $(".left2_bar").addClass("on"); 65 66 $(".menu-btn").click(function(){ 67 $(this).toggleClass("on"); 68 $(".nav001").toggleClass("on"); 69 70 71 $("header .logo").toggleClass("on"); 72 $(".left_bar").toggleClass("bg"); 73 // $(".left_bar .menu").fadeToggle(); 74 }); 75 76 $(".menu").click(function () { 77 $(this).toggleClass("on"); 78 $(".nav001").toggleClass("on"); 79 80 81 $("header .logo").toggleClass("on"); 82 $(".left_bar").toggleClass("bg"); 83 }); 84 85 86 87 88 $(".bottom_bar").addClass("on"); 89 90 $(".bottom_bar .left").addClass("on"); 91 92 $(".bottom_bar .center").addClass("on"); 93 94 95 96 $(".bottom_bar .center .miso-prev").addClass("on"); 97 $(".bottom_bar .center .miso-next").addClass("on"); 98 99 100 101 $(".left_bar dl dd").addClass("aos-init aos-animate"); 102 103 $(".message").addClass("on"); 104 105 /*äºç»´ç */ 106 $(".n_header .right .ewm").click(function(){ 107 $(".n_header .right .ewm .ewm_tc").fadeToggle(); 108 $(".n_header .right .ewm .ewm_tc").toggleClass("on"); 109 $(".n_header .right .lan .yuyan").fadeOut(); 110 $(".n_header .right .lan .yuyan").removeClass("on"); 111 }); 112 $(".n_header .right .lan").click(function(){ 113 $(".n_header .right .lan .yuyan").fadeToggle(); 114 $(".n_header .right .lan .yuyan").toggleClass("on"); 115 $(".n_header .right .ewm .ewm_tc").fadeOut(); 116 $(".n_header .right .ewm .ewm_tc").removeClass("on"); 117 }); 118 119 /*导èª*/ 120 $("#nav li").hover(function () { 121 if ($(this).find(".subnav").length > 0) { 122 $(this).children("a").addClass("hov"); 123 $(this).find(".subnav").stop(false, false).animate({top:46,"opacity":"show"},350); 124 $(this).find(".nav_img").stop(false, false).animate({top:46,"opacity":"show"},350); 125 }; 126 }, function () { 127 $(this).children("a").removeClass("hov"); 128 $(this).children(".subnav").stop(false, false).fadeOut(250,function(){$(this).css("top","23");}) 129 $(this).children(".nav_img").stop(false, false).fadeOut(250,function(){$(this).css("top","23");}) 130 }); 131 $(".nav .subnav a").click(function(e){
132 var hash=$(this).attr("href").split("#")[1]; 133 if(hash && $("#"+hash).length==1){ 134 e.preventDefault(); 135 $("html,body").animate({ scrollTop: $("#"+hash).offset().top-atH}, 0); 136 } 137 }) 138 139 var $menuBtn = jQuery('.menu-handler'); 140 var $menuBox = jQuery(".menu-Box"); 141 142 $menuBtn.bind("click", function () { 143 if (navItem == 0) { 144 $(this).addClass("active"); 145 $("html").addClass("menuOpen"); 146 $menuBox.addClass("menu-Box-btn"); 147 navItem = 1; 148 }else{ 149 $(this).removeClass("active"); 150 $("html").removeClass("menuOpen"); 151 $menuBox.removeClass("menu-Box-btn"); 152 navItem = 0; 153 } 154 }); 155 $(".pusher-black").bind("click", function () { 156 if (navItem == 1 ) { 157 $menuBtn.removeClass("active"); 158 $("html").removeClass("menuOpen"); 159 $menuBox.removeClass("menu-Box-btn"); 160 navItem = 0; 161 navItem = 0; 162 }; 163 }); 164 165 $menuBtn.removeClass("active"); 166 $("html").removeClass("menuOpen"); 167 $menuBox.removeClass("menu-Box-btn"); 168 navItem = 0; 169 /*导èª*/ 170 171 //ç§»å¨ç«¯å é¡µå¯¼èª 172 $("#bnt_sub_nav").click(function(){ 173 $(this).toggleClass("on"); 174 $("#sub_nav_content").slideToggle(); 175 }); 176 177 $("#sub_nav_content dt.title a").attr("href","javascript:void(0)"); 178 $("#sub_nav_content dt.title_on").next("dd").show(); 179 $("#sub_nav_content dt.title").click(function() { 180 if ($(this).hasClass("title_on")) { 181 $(this).next("dd").slideToggle(); 182 $(this).removeClass("title_on"); 183 } else { 184 $("#sub_nav_content dd").slideUp(); 185 $("#sub_nav_content dt.title").removeClass("title_on").removeClass("on"); 186 $(this).toggleClass("title_on"); 187 $(this).next("dd").slideDown(); 188 } 189 }); 190 191 /*æé£ç´*/ 192 var Accordion = function(el, multiple) { 193 this.el = el || {}; 194 this.multiple = multiple || false; 195 196 // Variables privadas 197 var links = this.el.find('.link'); 198 // Evento 199 links.on('click', {el: this.el, multiple: this.multiple}, this.dropdown) 200 }; 201 202 Accordion.prototype.dropdown = function(e) { 203 var $el = e.data.el; 204 $this = $(this); 205 $next = $this.next(); 206 207 $next.slideToggle(); 208 $this.parent().toggleClass('open'); 209 $this.parent().parent().toggleClass('lwy'); 210 211 if (!e.data.multiple) { 212 $el.find('.submenu').not($next).slideUp().parent().removeClass('open'); 213 } 214 }; 215 216 var accordion = new Accordion($('#accordion'), false); 217 $('.submenu li').click(function () { 218 $(this).addClass('current').siblings('li').removeClass('current'); 219 }); 220});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.