|
- $(document).ready(function () {
-
- // introduce--activity
- activityFun();
-
- var wid = document.body.clientWidth;
- $(".banner .img").find("li").css("width",wid);
-
- if($(".banner .img li").size() > 1){
- var clone=$(".banner .img li").first().clone();
- $(".banner .img").append(clone);
- setBanner(wid);
- }
-
- })
-
-
- function activityFun(){
- $(".homepage_introduce ul").on("hover","li",function () {
- $(".homepage_introduce ul li").removeClass("active");
- $(this).addClass("active");
- $(".homepage_introduce_content_item").removeClass("active");
- $(".homepage_introduce_content_item").eq(parseInt($(this).index())).addClass("active");
- })
-
- $(".plateContainer").hover(function () {
- $(this).find(".plate_back").animate({opacity: 1,zIndex: 2},500);
-
- $(this).find(".plate_before").animate({opacity: 0,zIndex: 1},500);
- },function () {
- $(this).find(".plate_back").animate({opacity: 0,zIndex: 1},500);
-
- $(this).find(".plate_before").animate({opacity: 1,zIndex: 2},500);
- })
- }
-
- var t;
- var i=0;
-
- function setBanner(wid) {
-
- var ulWid=wid * parseInt($(".banner .img").find("li").length);
-
- $(".banner .img").css("width",ulWid);
-
-
- var size = $(".banner .img li").size();
-
- // for(var j=0;j<size-1;j++){
- // $(".banner .num").append("<li></li>");
- // }
-
- /*自动轮播*/
- t=setInterval(function(){
- i++;
- move();
- },3000);
-
- function move(){
- if(i==size){
- $(".banner .img").css({left:0});
- i=1;
- }
- if(i==-1){
- $(".banner .img").css({left:-(size-1)*wid});
- i=size-2;
- }
-
- $(".banner .img").stop().animate({left:-i*wid},1000);
-
- // if(i==size-1){
- // $(".banner .num li").eq(0).addClass('on').siblings().removeClass('on');
- // }else{
- // $(".banner .num li").eq(i).addClass('on').siblings().removeClass('on');
- // }
- }
- }
-
- $(window).resize(function () {
- var wid = document.body.clientWidth;
- $(".banner .img").find("li").css("width",wid);
- if($(".banner .img li").size() > 1) {
- clearInterval(t);
-
- $(".banner .img").stop().animate({left: -i * wid}, 1000);
-
- setBanner(wid);
- }
-
-
- })
|