// JavaScript Document //璁剧疆棣栭〉瑙嗛鑳屾櫙閾烘弧娴忚鍣ㄧ獥鍙 $(document).ready(function() { // 褰撴祻瑙堝櫒杞藉叆鏃舵敼鍙樺厓绱犻珮搴 //$('#adSwiper').css('height', $(window).height());//video楂樺害濮嬬粓涓庢祻瑙堝櫒绐楀彛涓€鑷 $(document).scroll(function() { //var chaHeight=$(".zwLeft").height()-($(window).height()-210); //console.log(chaHeight); if($(window).scrollTop()>140){ $(".inpage-nav").addClass("inpage-navTop"); $(".moreRight").addClass("fixed"); $(".leftshare .box1").addClass("fixed"); $(".zhengwen .share-out").addClass("on"); }else{ $(".inpage-nav").removeClass("inpage-navTop"); $(".moreRight").removeClass("fixed"); $(".leftshare .box1").removeClass("fixed"); $(".zhengwen .share-out").removeClass("on"); } // if($(window).scrollTop()>120){ // $("#procategory").addClass("fixed"); // //$("#prolists").css("margin-top",$("#procategory").height()+"px"); // }else{ // $("#procategory").removeClass("fixed"); // //$("#prolists").css("margin-top",0); // } }); $(".zwLeft").css("min-height",($(window).height()-300)+"px"); }); //褰撴祻瑙堝櫒绐楀彛鏀瑰彉澶у皬鏃舵敼鍙樺厓绱犻珮搴 $(function(){ // if($(window).width()/$(window).height()<1.78){ // $("#adSwiper .swiper-slide").css("background-size","auto 100%"); // } $('#indexReTop').click(function(){ $('body,html').animate({scrollTop:0},500); }); var timer = 0; //鍑芥暟鑺傛祦鍙橀噺 $(window).resize(function(){ //绐楀彛鍙樺寲鏃舵墽琛 var winH=$(window).height() //$('#adSwiper').css('height', $(window).height()); // if($(window).width()/winH<1.78){ // $("#adSwiper .swiper-slide").css("background-size","auto 100%"); // } // else{ // $("#adSwiper .swiper-slide").css("background-size","100% auto"); // } // if(winH<740){ // $(".homeZhaoshang .container").css("height",winH*0.9); // $(".homeShop .container").css("height",winH*0.9); // } if(winH>800){ clearTimeout(timer);//鍘婚櫎鍑芥暟鑺傛祦璁℃椂鍣 timer = setTimeout(function() {//鍑芥暟鑺傛祦璁℃椂鍣 $('#bg-video-box').css('height', winH);//video楂樺害濮嬬粓涓庢祻瑙堝櫒绐楀彛涓€鑷 // $('#adSwiper .swiper-slide').css('height', winH); }, 200); } // layer.full(layerindex); }); //椤靛ご鏍忕洰 var tab="{$tab}"; /*if(tab==17){ $(".my-sound img").removeClass("playsound"); //setTimeout('$(".my-sound img").removeClass("playsound")',25000); //playBgsound(); //autoPlayMusic(); } else{ $(".my-sound img").removeClass("playsound"); } */ $(".my-navbar>div:not(:last)").mouseenter(function(e){ //$(this).children("div").animate({left:0}); $(".allsearch").children("div").hide(); $(this).siblings('div').children(".item").hide(0); $(this).children(".item").fadeIn(200); $(this).children("a").addClass("active"); }); $(".my-navbar>div").mouseleave(function(e){ //$(this).children("div").animate({left:"-150px"}); $(this).children(".item").fadeOut(200); $(this).children("a").removeClass("active"); }); $(".allsearch>i").click(function(e){ //$(this).children("div").animate({left:0}); var nowdiv=$(this).siblings('div'); if(nowdiv.is(':hidden')){銆€銆€//濡傛灉node鏄殣钘忕殑鍒欐樉绀簄ode鍏冪礌锛屽惁鍒欓殣钘 nowdiv.fadeIn(200); }else{ nowdiv.fadeOut(200); } }); $('.oneclass li').on('mouseenter', function(index) { var index = $(this).index() $('.oneclass li>div').hide(); $(this).children("div").show(); }) $('#flink').change(function(){ var link = $(this).val(); if(link != ''){ window.open(link); } }); }); //鎵撳紑缇や簩缁寸爜銆佸璐簩缁寸爜 function openQr(img,name){ $(".bigbox img").attr('src',img); $(".bigbox p").text(name); $(".bigbox").fadeIn(300); } //鍏抽棴缇や簩缁寸爜銆佸璐簩缁寸爜 function closeQr(that){ $(that).fadeOut(300); } //鐐硅禐 function clickLove(action,id){ if(islove==true){ islove=false $.ajax({ url: "/addlove.html?action="+action+"&id="+id, // 鏇挎崲涓轰綘鐨勬暟鎹帴鍙RL锛屽苟甯︿笂鍒嗛〉鍙傛暟 type: 'GET', dataType: 'json', success: function(data) { console.log(data) if(data.status==1){ $(".share-btn .love").addClass("on"); $(".share-btn .love").children("img").attr("src","/images/love-icon.png"); $("#lovenum").text(data.data); } }, error: function() { alert('鏁版嵁鍔犺浇澶辫触锛?); islove=true } }); } } //涓嬭浇涓績韬唤楠岃瘉 function dlcheck(){ var user=$("input[name='user']").val(); var pass=$("input[name='pass']").val(); if(user.length<1){ layer.msg('璇峰~鍐欑櫥褰曞笎鍙?,{shade:.5,icon: 0,time:2000}); } else if(pass.length<2){ layer.msg('璇峰~鍐欏瘑鐮?,{shade:.5,icon: 0,time:2000}); } else{ var loading1 = layer.load(); $.ajax({ url: "/download.html", data: {'user':user,'pass':pass}, type: "POST", dataType: "json", success: function(data) { console.log(data); layer.close(loading1); if(data.status==1){ window.location.href = window.location.href; //location.reload(); } else{ layer.msg(data.info,{shade:.5,icon: 0,time:3000}); } }, error: function(data) { layer.close(loading1); } }); } } //鎵撳紑娴獥椤甸潰 var layerindex=""; function openPage(pos,url){ var X = $(pos).offset().top+$(pos).outerHeight()/2; var Y = $(pos).offset().left+$(pos).outerWidth()/2; // console.log(X) // console.log(Y) layerindex = layer.open({ type: 2, skin:'openLayercss', title: '', //offset:[X+"px",Y+"px"], //scrollbar:false, content: url+"?h="+$(window).height(), end: function () {//鏃犺鏄‘璁よ繕鏄彇娑堬紝鍙灞傝閿€姣佷簡锛宔nd閮戒細鎵ц锛屼笉鎼哄甫浠讳綍鍙傛暟銆俵ayer.open鍏抽棴浜嬩欢 //location.reload();銆€銆€//layer.open鍏抽棴鍒锋柊 } }); layer.full(layerindex); } //鐐瑰嚮鎹㈠ぇ鍥 function changeProMini(pos){ var imgurl=$(pos).find("img").attr('src'); var promodel=$(pos).find("img").attr('data-model'); //var model=$(pos).find("img").attr('data-model'); $(pos).siblings().find('img').removeClass("check"); $(pos).children('img').addClass("check"); imgurl=imgurl.replace('xs_',''); $("#zhuantu").attr("src",imgurl); $("#ajax-tit").text(promodel); } // function changeVideo(id){ // if(runsta==true){ // runsta=false; // itData={id:id}; // $.ajax({ // type:"POST", // url:ajaxurl, // data:itData, // success: function(data,st){ // //console.log(data); // $("#video-tit").html(data['data']['title']); // $("#video-area").html(data['data']['outdata']); // var mt=($(window).height()-$(".modal-dialog").outerHeight())/2-25; // $(".modal-dialog").css('top',mt+'px'); // $("#modal-demo").modal("show"); // runsta=true; // }, // }); // } // } function changeVideo(title,path){ $("#video-tit").html(title); $("#video-area").html('