﻿/*!
 *JS相关文件 
 *
 *专注网络营销，网站推广，网站建设
 *
 *网址：
 *
 */
	 	var leftNavFocus = {
		init: function() {
			var elnav = $("[navcrumbs]").find("a");
			var elbody = $("[navvicefocus]").find("a");
			if (elnav && elbody) {
				for (var n = (elnav.length - 1); n >= 0; n --) {
					$.each(elbody, function(i, item) {
						if (elnav.eq(n).attr("href") === $(item).attr("href")) {
							$(item).parent().siblings().removeClass("sidenavcur");
							$(item).parent().addClass("sidenavcur");
							return false;
						}
					});
				}
			}
		}
	}; 
$(function(){
 //1、改变当前导航栏目背景
 /*&涓枃2017-01-05濮滅幃111&*/
	//鍓鑸劍鐐瑰畾浣�

 //2、通用鼠标放到图片上，图片透明度变化效果
  $('.hover_pic').hover(function(){
	$(this).stop().animate({opacity:"0.8"});
  }, function() {
	$(this).stop().animate({opacity:"1"});
  });
 //3、延迟加载
 $("img.lazy").lazyload({threshold :100,effect:"fadeIn",failurelimit:6,skip_invisible:false});
 //4、文本框或文本域默认文字
  $.each($('input,textarea'),function(p){
	if($('input,textarea').eq(p).attr('default')!=null){
		$('input,textarea').eq(p).val($(this).attr('default'));		
	}
  });
  $('input,textarea').focus(function(){
	  if($(this).val()==''||$(this).val()==$(this).attr('default')){$(this).val('');$(this).addClass('yys_hei');}
  })	
  $('input,textarea').blur(function(){
	  if($(this).val()==''||$(this).val()==$(this).attr('default')){
		 //$(this).attr({'type':'text'});
		 $(this).removeClass('yys_hei');
		 $(this).val($(this).attr('default'));		 
		
	  }
  });
  //鼠标经过显示二维码
	$ewm= $(".show");
	   $ewm.hover(function(){
		   $(this).show();}
	 );
	
	  $(".weixin,.shouji").hover(function(){
		  var par_w=$(this).width();
		  var ewm_width=$ewm.width();
		  var ewm_left=(ewm_width-par_w)/2;
		  
		 $ewm.css({'left':-ewm_left});
		  $(this).find($ewm).stop().fadeToggle();
		 })	;
  //5、导航二级菜单显示
  		   jQuery(".nav").slide({ 
				type:"menu",// 效果类型，针对菜单/导航而引入的参数（默认slide）
				titCell:".nLi", //鼠标触发对象
				targetCell:".subnav", //titCell里面包含的要显示/消失的对象
				effect:"slideDown", //targetCell下拉效果
				delayTime:500 , //效果时间
				triggerTime:0, //鼠标延迟触发时间（默认150）
				returnDefault:true //鼠标移走后返回默认状态，例如默认频道是“预告片”，鼠标移走后会返回“预告片”（默认false）
			}); 
	
	   //6、首页焦点图切换
		   jQuery(".banner").hover(function(){
			 $(".banner .prev").stop(true,true).animate({
			  left: '0',opacity: '1'
			 })
			 $(".banner .next").stop(true,true).animate({
			  right: '-1200',opacity: '1'
			 })
			},function(){
			  $(".banner .prev").stop(true,true).animate({
			   left: '-90',opacity: '0'
			  })
			  $(".banner .next").stop(true,true).animate({
			   right: '-1280',opacity: '0'
			  })
			});
        jQuery(".banner").slide({trigger:"mouseover",titCell:".hd li",mainCell:".bd ul", effect:"leftLoop",autoPlay:true,easing:"easeOutCirc",interTime:3000});	
		
	   //首页产品
		jQuery(".prolist_b").slide({ mainCell:".bd ul",vis:4,prevCell:".prev",nextCell:".next",effect:"leftLoop",autoPlay:true,});
		

		
	   //首页新闻切换
		 jQuery(".news_l").slide({effect:"leftLoop"});
		
	   //常见问题
	     jQuery(".news_r").slide({mainCell:".bd ul",autoPlay:true,effect:"topMarquee",vis:5,interTime:50,trigger:"click"});
	   
	   //推荐切换
	    jQuery(".conBox").slide({mainCell:".bd ul",autoPage:true,effect:"leftLoop",autoPlay:true,vis:3});
	   
	   //产品详情页 产品图片组
	   	jQuery(".picScroll-left").slide({titCell:".hd ul",mainCell:".bd ul",autoPage:true,effect:"left",vis:1,trigger:"click",delayTime:700});
	   
	   //首页产品导航
	    jQuery(".sideMen").slide({titCell:"h3", targetCell:"ul",effect:"slideDown",delayTime:300,defaultPlay:false,returnDefault:true});
		
		
	   //首页常见问题
	    jQuery(".news-bottom").slide({titCell:".hd ul",mainCell:".bd ul",autoPage:true,effect:"leftLoop",autoPlay:true,vis:2,trigger:"click"});
	    
	   
	   
});
(function(){
    leftNavFocus.init();
})();