// javascript document //屏幕宽度限制 $(function () { var removecssattr = function (elem, attr) { var s = elem.style; if (s.removeproperty) { s.removeproperty(attr); } else { s.removeattribute(attr);//兼容低版本ie } }; minwidth(); $(window).load(function () { $(window).resize(function () { minwidth(); }) }); function minwidth() { if ($(window).width() < 1260) { $("body").css({ "width": "1280px" }); } else { removecssattr(document.body, 'width'); } } //-------- 首页 -------- $(".invideolist ul li").hover(function () { $(this).find(".invideotitle").stop(true, true).animate({ "bottom": -35 }, 360); $(this).find(".invideotext").stop(true, true).animate({ "bottom": 0 }, 360); $(this).find('.invideobtn').hide(); }, function () { $(this).find(".invideotitle").stop(true, true).animate({ "bottom": 0 }, 360); $(this).find(".invideotext").stop(true, true).animate({ "bottom": -288 }, 360); $(this).find('.invideobtn').show(); }); $(".newscenterbtn a").eq(0).addclass("changecur"); $(".newslist").eq(0).show(); $(".newscenterbtn a").click(function () { var newindex = $(this).index(); $(this).addclass("changecur").siblings().removeclass("changecur"); $(".newslist").eq(newindex).show().siblings(".newslist").hide(); }); $(".newslist ul li").hover(function () { $(this).addclass("newcur"); }, function () { $(this).removeclass("newcur"); }); $(".topselect").hover(function () { $(this).find(".topslide").stop(true, true).slidedown(350); $('.topslide').width($(window).width()); }, function () { $(this).find(".topslide").stop(true, true).slideup(280); }); if($('.indexbanner ul').length > 0){ $(this).cycle({ fx: "scrollhorz", pagerevent: "click", pager: ".bannerbtn", speed: 800, timeout: 3000, pause: 1 }); } //-------- 首页产品中心 -------- $(".procentercont ul li").hover(function () { $(this).addclass("thisback"); }, function () { $(this).removeclass("thisback"); }) $(".changestar").eq(0).addclass("changestar0"); $(".changestar").eq(1).addclass("changestar1"); $(".changestar").eq(2).addclass("changestar2"); $(".changestar").eq(3).addclass("changestar3"); $(".changestar").eq(4).addclass("changestar4"); $(".changestar").eq(5).addclass("changestar5"); $(".changestar").eq(6).addclass("changestar6"); $(".procenterwrap").each(function () { var thisindex = $(this).index(); var thislilength = $(this).find("ul li").length; var thisliwidth = $(this).find("ul li").width()*12; $(this).find("ul").css("width", thislilength * thisliwidth); }); $(".procenterbtn").find("a").first().addclass("changecur"); $(".procenterwrap").first().show(); if($('.procenterbtn').length > 0){ $(".procenterbtn").find("a").click(function () { var thischange = $(this).index(); $(this).addclass("changecur").siblings().removeclass("changecur"); $(".procenterwrap").eq(thischange).show().siblings(".procenterwrap").hide(); var swiper = new swiper('.changestar' + thischange + '', { slidesperview: 4, nextbutton: '.changestar' + thischange + ' .proright', prevbutton: '.changestar' + thischange + ' .proleft', autoplay: false }) }); } if($('.procenterbtn').length > 0){ $(".procenterbtn").find("a").first().trigger("click"); var swiper = new swiper('.changestar0', { slidesperview: 4, nextbutton: '.changestar0 .proright', prevbutton: '.changestar0 .proleft', autoplay: false }); } //精彩视频 $('.web .videolist li').hover(function(){ $(this).find('div').stop(true,true).animate({top:'0'}); $(this).find('h3').addclass('cur'); $(this).find('a').show(); $(this).find('i').stop(true,true).animate({top:'199px'}); },function(){ $(this).find('div').stop(true,true).animate({top:'253px'}); $(this).find('h3').removeclass('cur'); $(this).find('a').hide(); $(this).find('i').stop(true,true).animate({top:'115px'}); }) $('.templatecon .videolist li').hover(function(){ $(this).find('div').stop(true,true).animate({top:'0'}); $(this).find('h3').addclass('cur'); $(this).find('a').show(); $(this).find('i').stop(true,true).animate({top:'179px'}); },function(){ $(this).find('div').stop(true,true).animate({top:'193px'}); $(this).find('h3').removeclass('cur'); $(this).find('a').hide(); $(this).find('i').stop(true,true).animate({top:'90px'}); }) //展厅 $('.showroomtop_left_select1 .choose').click(function(){ $(this).siblings().stop(true,true).slidetoggle() }) $('.showroomtop_left_select1 ul li').click(function(){ $(this).parent().siblings().text($(this).text()); $(this).parent().stop(true,true).slideup() }) //视频 $(".videolist li a,.videolist li i").click(function () { $(".videotc").fadein(); $(".videotc").css({ "height": $("body").height() }); var filepath = $(this).attr("_video"); $(".videocon").html("" + " " + "" + "" + " " + " " + " " + " " + ""); $(".videotcweb").css({ "margin-top": ($(window).height() - $(".videotcweb").outerheight()) / 2 }); $(".videotcwebtit h3").text($(this).attr("_title")); $(".videotc_close").click(function () { $(".videotc").fadeout(); $("#_video_wd").remove(); }); }); //图片窗口 function imgwindow(){ $(".showroomlist_con li a").click(function() { var imgsrc=""; var llirel=$(this).attr("imgsrc"); imgsrc=llirel; ss=imgsrc.split(","); $(".imageswindow").fadein(500); $(".images img").attr("src",ss[0]); _click=0; if(ss.length<2){ $('.listprev,.listnext').hide() } }); $(".listprev").click(function(){ if(_click==0){ return false; }else{ _click--; $(".images img").attr("src",ss[_click]); } }) $(".listnext").click(function(){ if(_click>ss.length-2){ return false; }else{ _click++; $(".images img").attr("src",ss[_click]); } }) $(".closewindow").click(function(){ $(".imageswindow").fadeout(500); }) $('.imageswindowwrap').css({'margin-top':($(window).height()-($('.imageswindowwrap').outerheight()))/2}) } imgwindow(); $(window).resize(function(){ imgwindow(); }) //返回顶部 //$(window).scroll(function(){ // var scrolltop=$(window).scrolltop(); // if(scrolltop > 400){ // $('.returntop').stop(true,true).fadein() // }else{ // $('.returntop').stop(true,true).fadeout() // } //}) /*$('.returntop').click(function(){ $('html,body').stop(true,true).animate({'scrolltop':0}) })*/ }) function stopevent() { //阻止冒泡事件 //取消事件冒泡 var e = arguments.callee.caller.arguments[0] || event; //若省略此句,下面的e改为event,ie运行可以,但是其他浏览器就不兼容 if (e && e.stoppropagation) { // this code is for mozilla and opera e.stoppropagation(); } else if (window.event) { // this code is for ie window.event.cancelbubble = true; } }