// javascript document $(function () { $(".snewcm").append($(".snewcm").html()) var size=$(".snewcm ul").size() var len=1233; $(".snewcm").css({"width":size*len+"px","left":-size/2*len+"px"}) for(var a=0; a") } $(".snewdian span").eq(0).addclass("hovdian") $(".snewdian span").hover(function(){ clearinterval(timer) $(".snewdian span").removeclass("hovdian") $(".snewdian span").eq($(this).index()).addclass("hovdian") l = -len*($(this).index()+size/2); $(".snewcm").animate({ "left": l + "px" }, 1000,function(){ if(parseint($(".snewcm").css("left"))==-size*len+len){ $(".snewcm").css({"left":-(size/2-1)*len+"px"}) } }) },function(){ timer = setinterval(init, 5000); }) $(".snewcm li").hover(function(){clearinterval(timer) },function(){timer = setinterval(init, 5000);}) timer = setinterval(init, 5000); function init() { l = parseint($(".snewcm").css("left")) - len; $(".snewdian span").removeclass("hovdian") $(".snewdian span").eq(-l/len-size/2).addclass("hovdian") if (!$(".snewcm").is(":animated")) { $(".snewcm").animate({ "left": l + "px" }, 1000,function(){ if(parseint($(".snewcm").css("left"))==-size*len+len){ $(".snewcm").css({"left":-(size/2-1)*len+"px"}) } }) } } $(".zerendh ul").append($(".zerendh ul").html()) $(".zerendh ul li").addclass("zrnone") $(".zerendh ul li").eq(0).attr("class", "zerendhd") $(".zerendh ul li").eq(1).attr("class", "") var sl = $(".zerendh li").size() var dj; $(".zerendh li").click(function () { if ($(this).attr("class") == null || $(this).attr("class") == "") { dj = $(this).index() if (dj + 1 > sl - 1) { $(".zerendh li").eq(0).animate({ "height": "123px", "width": "181px", "top": "257px" }, 700 , function () { $(".zerendh li").eq(0).removeclass("zrnone") }) } else { $(".zerendh li").eq(dj + 1).animate({ "height": "123px", "width": "181px", "top": "257px" }, 700, function () { $(".zerendh li").eq(dj + 1).removeclass("zrnone") }) } $(this).animate({ "height": "355px", "right": "0px", "top": "0px", "width": "528px" }, 700, function () { $(this).attr("class", "zerendhd") if (dj - 1 < 0) { $(".zerendh li").eq(sl - 1).css({ "height": "0px", "right": "-60px", "top": "380px", "width": "0px" }) $(".zerendh li").eq(sl - 1).removeclass("zerendhd") } else { $(".zerendh li").eq(dj - 1).css({ "height": "0px", "right": "-60px", "top": "380px", "width": "0px" }) $(".zerendh li").eq(dj - 1).removeclass("zerendhd") } }) //settimeout(a(),7000); } function a() { if (dj - 1 < 0) { $(".zerendh li").eq(sl - 1).addclass("zrnone").delay(7000).removeclass("zerendhd") } else { $(".zerendh li").eq(dj - 1).addclass("zrnone").delay(7000).removeclass("zerendhd") } } }) bannerresize = function () { // ��ҳbanner(ͼƭ����1920*800) var winh = $(window).outerheight(); var winw = $(window).outerwidth(); var imgscale = winw / (winh) //�ж�ͼƭ���� if (imgscale > 2.4) { var imgheight = (winw / 2.4); $('.banner_img').width(winw); $('.banner_img').height(imgheight); $('.banner_img').css({ "margin-top": -(imgheight - winh) / 2 }) } else { var imgwidth = (winh) * 2.4; $('.i_banner').height(winh); $('.i_banner > ul').height(winh); $('.i_banner > ul li').height(winh); $('.banner_img').height(winh); $('.banner_img').width((winh) * 2.4); $('.banner_img').css({ "margin-left": -(imgwidth - winw) / 2 }); } } //banner owl })