// javascript document $(function(){ //ie9 兼容placdholder属性 function placeholdersupport() { return 'placeholder' in document.createelement('input'); } if(!placeholdersupport()){ // 判断浏览器是否支持 placeholder $("[placeholder]").each(function(){ var _this = $(this); // console.log($(this).height()); var inputheight = parseint(parseint($(this).height()-2)-14)/2; var inputheight = parseint(parseint(parseint($(this).height()-2)/2)-7)+'px'; _this.parent().css({"position": "relative"}); var left = _this.position().left+parseint(_this.css("padding-left"))+parseint(_this.css("margin-left"))+"px"; var top = parseint(_this.css("padding-top"));//+parseint(_this.css("margin-top"))+"px"; var top = parseint(_this.css("padding-top"));//+parseint(_this.css("margin-top"))+"px"; _this.after('' + _this.attr("placeholder") + ''); //_this.after('' + _this.attr("placeholder") + ''); if(_this.val() != ""){ _this.parent().find("span.placeholder").hide(); } else{ _this.parent().find("span.placeholder").show(); } }).on("focus", function(){ $(this).parent().find("span.placeholder").hide(); }).on("blur", function(){ var _this = $(this); if(_this.val() != ""){ _this.parent().find("span.placeholder").hide(); } else{ _this.parent().find("span.placeholder").show(); } }); // 点击表示placeholder的标签相当于触发input $("span.placeholder").on("click", function(){ $(this).hide(); $(this).siblings("[placeholder]").trigger("click"); $(this).siblings("[placeholder]").trigger("focus"); }); } /*二维码*/ $("header .right .ewm").click(function(){ $("header .right .ewm .ewm_tc").fadetoggle(); $("header .right .ewm .ewm_tc").toggleclass("on"); $("header .right .lan .yuyan").fadeout(); $("header .right .lan .yuyan").removeclass("on"); }); $("header .right .lan").click(function(){ $("header .right .lan .yuyan").fadetoggle(); $("header .right .lan .yuyan").toggleclass("on"); $("header .right .ewm .ewm_tc").fadeout(); $("header .right .ewm .ewm_tc").removeclass("on"); }); $(".banner ul").miso({ autoplayspeed: 5000, autoplay: true, speed: 800, fade: true, slidestoshow: 1, slidestoscroll: 1, easing:"easeinoutexpo", dots: true, arrows: true }); $("header").addclass("on"); $(".left_bar").addclass("on"); $(".menu-btn").click(function(){ $(this).toggleclass("on"); $(".nav001").toggleclass("on"); $("header .logo").toggleclass("on"); $(".left_bar").toggleclass("bg"); $(".left_bar .menu").fadetoggle(); }); $(".bottom_bar").addclass("on"); $(".bottom_bar .left").addclass("on"); $(".bottom_bar .center").addclass("on"); $(".bottom_bar .center ul").miso({ autoplayspeed: 5000, autoplay: true, speed: 800, fade: true, slidestoshow: 1, slidestoscroll: 1, easing:"easeinoutexpo", dots: false }); $(".bottom_bar .center .miso-prev").addclass("on"); $(".bottom_bar .center .miso-next").addclass("on"); $(".bottom_bar .right ul").miso({ autoplayspeed: 5000, autoplay: true, speed: 800, vertical: true, slidestoshow: 1, slidestoscroll: 1, easing:"easeinoutexpo", dots: false }); $(".left_bar dl dd").addclass("aos-init aos-animate"); $(".message").addclass("on"); /*二维码*/ $(".n_header .right .ewm").click(function(){ $(".n_header .right .ewm .ewm_tc").fadetoggle(); $(".n_header .right .ewm .ewm_tc").toggleclass("on"); $(".n_header .right .lan .yuyan").fadeout(); $(".n_header .right .lan .yuyan").removeclass("on"); }); $(".n_header .right .lan").click(function(){ $(".n_header .right .lan .yuyan").fadetoggle(); $(".n_header .right .lan .yuyan").toggleclass("on"); $(".n_header .right .ewm .ewm_tc").fadeout(); $(".n_header .right .ewm .ewm_tc").removeclass("on"); }); /*导航*/ $("#nav li").hover(function () { if ($(this).find(".subnav").length > 0) { $(this).children("a").addclass("hov"); $(this).find(".subnav").stop(false, false).animate({top:46,"opacity":"show"},350); $(this).find(".nav_img").stop(false, false).animate({top:46,"opacity":"show"},350); }; }, function () { $(this).children("a").removeclass("hov"); $(this).children(".subnav").stop(false, false).fadeout(250,function(){$(this).css("top","23");}) $(this).children(".nav_img").stop(false, false).fadeout(250,function(){$(this).css("top","23");}) }); $(".nav .subnav a").click(function(e){ var hash=$(this).attr("href").split("#")[1]; if(hash && $("#"+hash).length==1){ e.preventdefault(); $("html,body").animate({ scrolltop: $("#"+hash).offset().top-ath}, 0); } }) var $menubtn = jquery('.menu-handler'); var $menubox = jquery(".menu-box"); $menubtn.bind("click", function () { if (navitem == 0) { $(this).addclass("active"); $("html").addclass("menuopen"); $menubox.addclass("menu-box-btn"); navitem = 1; }else{ $(this).removeclass("active"); $("html").removeclass("menuopen"); $menubox.removeclass("menu-box-btn"); navitem = 0; } }); $(".pusher-black").bind("click", function () { if (navitem == 1 ) { $menubtn.removeclass("active"); $("html").removeclass("menuopen"); $menubox.removeclass("menu-box-btn"); navitem = 0; navitem = 0; }; }); $menubtn.removeclass("active"); $("html").removeclass("menuopen"); $menubox.removeclass("menu-box-btn"); navitem = 0; /*导航*/ //移动端内页导航 $("#bnt_sub_nav").click(function(){ $(this).toggleclass("on"); $("#sub_nav_content").slidetoggle(); }); $("#sub_nav_content dt.title a").attr("href","javascript:void(0)"); $("#sub_nav_content dt.title_on").next("dd").show(); $("#sub_nav_content dt.title").click(function() { if ($(this).hasclass("title_on")) { $(this).next("dd").slidetoggle(); $(this).removeclass("title_on"); } else { $("#sub_nav_content dd").slideup(); $("#sub_nav_content dt.title").removeclass("title_on").removeclass("on"); $(this).toggleclass("title_on"); $(this).next("dd").slidedown(); } }); /*手风琴*/ var accordion = function(el, multiple) { this.el = el || {}; this.multiple = multiple || false; // variables privadas var links = this.el.find('.link'); // evento links.on('click', {el: this.el, multiple: this.multiple}, this.dropdown) }; accordion.prototype.dropdown = function(e) { var $el = e.data.el; $this = $(this); $next = $this.next(); $next.slidetoggle(); $this.parent().toggleclass('open'); $this.parent().parent().toggleclass('lwy'); if (!e.data.multiple) { $el.find('.submenu').not($next).slideup().parent().removeclass('open'); } }; var accordion = new accordion($('#accordion'), false); $('.submenu li').click(function () { $(this).addclass('current').siblings('li').removeclass('current'); }); });