www.gusucode.com > 【T775】装修建材地板类网站织梦模板源码程序 > 【T775】装修建材地板类网站织梦模板/templets/lanfei/js/kl.js
$(function(){ $(".product_img_right_warp img").hide().eq(0).show(); $(".pro_big_img img").hide().eq(0).show(); var obj=$(".index_con_mid_list"); var object=$(".index_con_mid_list li"); var num= 1; var time = Math.ceil($(object).length); var n=0; if ($(object).length > 4) { $(object).clone().appendTo(obj); $(".index_con_mid_right img").click(function(){ if(!$(obj).is(":animated")){ if(n==time){n=0;$(obj).css({left:0});}; $(obj).animate({left: "-="+(object.width()+16)}, 500); n++; } }); $(".index_con_mid_left img").click(function(){ if(!$(obj).is(":animated")){ if(n==0) { n=time; $(obj).css({left:-(object.width()+16)*time}) }; $(obj).animate({left: "+="+(object.width()+16)}, 500); n--; } }); } $(".index_con_mid_left img").hover(function() { clearInterval(index_con_mid_list_time); }, function() { index_con_mid_list_time = setInterval(function(){ $(".index_video_left").click(); }, 2000); }).trigger("mouseleave"); /*var obj1=$(".product_img_left_bot_mid"); var object1=$(".product_img_left_bot_mid li"); var num1= 1; var time1 = Math.ceil($(object1).length); var n1=0; $(object1).clone().appendTo(obj1); $(".product_img_left_bot_left").click(function(){ if(!$(obj1).is(":animated")){ if(n1==time1){n=0;$(obj1).css({left:0});}; $(obj1).animate({left: "-="+(object1.width()+4)}, 500); n1++; } }); $(".product_img_left_bot_right").click(function(){ if(!$(obj1).is(":animated")){ if(n1==0) { n1=time1; $(obj1).css({left:-(object1.width()+4)*time1}) }; $(obj1).animate({left: "+="+(object1.width()+4)}, 500); n1--; } }); $(".product_img_left_bot_left").hover(function() { clearInterval(product_img_left_bot_mid_time); }, function() { product_img_left_bot_mid_time = setInterval(function(){ $(".index_video_left").click(); }, 2000); }).trigger("mouseleave"); */ $(".product_img_left_bot_mid > li").hover(function(){ $(".product_img_left_bot_mid > li").removeClass("press").eq($(this).index()).addClass("press"); $(".product_img_right_warp img").hide().eq($(this).index()).show(); }); $(".product_img_list > li").hover(function(){ $(".product_img_list > li").removeClass("press").eq($(this).index()).addClass("press"); }); $(".pro_small_select_img > li").hover(function(){ $(".pro_big_img img").hide().eq($(this).index()).show(); }); var proview_img_entry_len = $(".product_img_left_bot_mid > li").length-3; var proview_img_entry_i = 0; if ($(".product_img_left_bot_mid > li").length > 3) { $(".product_img_left_bot_left").click(function(){ if (proview_img_entry_i < proview_img_entry_len) { if (!$(".product_img_left_bot_mid").is(":animated")) { proview_img_entry_i = proview_img_entry_i + 1; $(".product_img_left_bot_mid").animate({ left: -(85 * proview_img_entry_i) }, 500); } } }); $(".product_img_left_bot_right").click(function(){ if (proview_img_entry_i > 0) { if (!$(".product_img_left_bot_mid").is(":animated")) { proview_img_entry_i = proview_img_entry_i - 1; $(".product_img_left_bot_mid").animate({ left: -(85 * proview_img_entry_i) }, 500); } } }); } $(".kl_left_list li").click(function(){ if ($(this).children(".kl_left_list2").children("li").length > 0) { if($(this).children(".kl_left_list2").css("display") == "none") { $(".kl_left_list2").slideUp(); } $(this).children(".kl_left_list2").slideToggle(); } }); var q = 0; $(".index_show_page1").eq(0).hide(); $(".index_show_page2").eq(0).show(); $(".index_show_page > li").click(function(){ $(".index_sjow_empty_img").fadeOut(300).eq($(this).index()).fadeIn(300); $(".index_show_page1").show(); $(".index_show_page1").eq($(this).index()).hide(); $(".index_show_page2").hide().eq($(this).index()).show(); q = $(this).index(); }); $(".index_sjow_empty_img").hide().eq(0).show(); $(".index_show_warp").hover(function() { clearInterval(index_show_time); }, function() { index_show_time = setInterval(function(){ if (q >= $(".index_sjow_empty_img").length-1) { q = 0; } else { q = q+1; } index_show_imgs(q); }, 10000); }).trigger("mouseleave"); $(".pro_imgshow_bg").height($("body").height()); /*$(".product_img_empty > li").click(function(){ $(".pro_imgshow_bot_size").html(""); $(".pro_imgshow_bot_size1").html(""); $(".pro_imgshow_bot_size").html($(this).children(".product_img_empty_caption").html()); $(".pro_imgshow_bot_size1").html($(this).children(".product_img_empty_con").html()); $(".pro_imgshow_bg,.pro_imgshow").show(); }); $(".pro_imgshow_top img").click(function(){ $(".pro_imgshow_bg,.pro_imgshow").hide(); $(".pro_imgshow_bot_size").html(""); $(".pro_imgshow_bot_size1").html(""); });*/ $(".index_con_left").hide().eq(0).show(); $(".index_con_left_title > li").mouseover(function(){ $(".index_con_left_title > li").removeClass("press").eq($(this).index()).addClass("press"); $(".index_con_left").hide().eq($(this).index()).show(); }); $(".kl_banner_img").hide().eq(0).show(); var y = 0; $(".kl_banner").hover(function() { clearInterval(sub_ban_time); }, function() { sub_ban_time = setInterval(function(){ if (y >= $(".kl_banner_img").length-1) { y = 0; } else { y = y + 1; } sub_ban_img(y); }, 5000); }).trigger("mouseleave"); $('.product_img_empty li a').lightBox(); $('.product_img_empty1 li a').lightBox(); $(".kl_kefu_small").click(function(){ $(".kl_kefu_big").show(); $(".kl_kefu_small").hide(); }); $(".kl_kefu_big_top b").click(function(){ $(".kl_kefu_big").hide(); $(".kl_kefu_small").show(); }); var offsetTop = 0; $(window).scroll(function() { offsetTop = null; offsetTop =$(window).scrollTop() + 200 ; $(".kl_kefu").animate({ top: offsetTop }, { duration: 300, queue: false }) }); }); function index_show_imgs(q) { $(".index_sjow_empty_img").fadeOut(600).eq(q).fadeIn(600) $(".index_show_page1").show(); $(".index_show_page1").eq(q).hide(); $(".index_show_page2").hide().eq(q).show(); } function sub_ban_img(y) { $(".kl_banner_img").fadeOut(1500).eq(y).fadeIn(1500); }