importshow.js 2.83 KB
$(function(){
	$(".nav-h2").hide();
	$(".common_nav").hover(
		function(){
			$(this).children(".nav-h2").show();
		},
		function(){
			$(this).children(".nav-h2").hide();
		}
	);
	Tools.setSelected('u-listsum-1 dd', 'a', 'on');
	
	//轮播左右点击按钮
	// $('.img-roll').hover(function(){
		// $(this).find('a').css('z-index','2');
	// },function(){
		// $(this).find('a').css('z-index','-1');
	// });
	// $('.mn-tab').hover(function(){
		// $(this).find('a').css('z-index','2');
	// },function(){
		// $(this).find('a').css('z-index','-1');
	// });
	//轮播
	$('.imp1').dilislider({
		page : 3,
		point : '.nw1 a',
		unitlen : $('.imp1').width()
	});
	$('.imp2').dilislider({
		page : 3,
		time : 5000,
		point : '.nw2 a',
		unitlen : $('.imp2').width()
	});
	$('.imp3').dilislider({
		page : 3,
		time : 5000,
		point : '.nw3 a',
		unitlen : $('.imp3').width()
	});
	$('.ci').dilislider({
		page : 3,
		time : 5000,
		unitlen : $('.ci').height(),
		direction : 'top',
		point : '.rg a'
	});
	var tab = $('#mn-tab').dilislider({
		page : 4,
		point : '.a-point li',
		direction : 'fading'
	});
	var ir1 = $('#ir-1').dilislider({
		page : 3,
		unitlen : $('#ir-1').width()
	});
	var cd1 = $('#cd-1').dilislider({
		page : 3,
		direction : 'fading'
	});
	setTimeout(function(){
		var ir2 = $('#ir-2').dilislider({
		page : 3,
		unitlen : $('#ir-2').width()
		});
		var cd2 = $('#cd-2').dilislider({
			page : 3,
			direction : 'fading'
		});
	}, 3000)
	//轮播点击事件
	$('.bp').click(function(){
		tab.actionLeft();		
		return false;
	});
	$('.bn').click(function(){
		tab.actionRight();				
		return false;
	});
	$('.bp1').click(function(){
		cd1.actionLeft();
		ir1.actionLeft();
		return false;
	});
	$('.bn1').click(function(){
		ir1.actionRight();
		cd1.actionRight();
		return false;
	});
	$('.bp2').click(function(){
		cd2.actionLeft();
		ir2.actionLeft();
		return false;
	});
	$('.bn2').click(function(){
		cd2.actionRight();
		ir2.actionRight();
		return false;
	});
	
	
	//列表图片左横移
	function sidesway(cname, distance, speed){
		$('.'+cname).hover(function(){
			$(this).parent().css('border-color', '#f00');
			if ($(this).css('marginLeft') == '0px'){
				$(this).animate({marginLeft: distance+'px'}, speed);
			};
		},function(){
			$(this).parent().css('border-color', '#ccc #fff #ccc #ccc');
			$(this).animate({marginLeft: '0'}, speed);
			if ($(this).css('marginLeft') != distance+'px'){
				$(this).stop();
			};
		});
	};
	var f = new sidesway('fresh-wrapper',-180,'normal');
	var m = new sidesway('fresh-wrapper-m',-135,'normal');
	
	//点评选择
	$('.com-tt a').bind('click', function(){
		$(this).addClass('on');
		if ($(this).find('i').hasClass('down')){
			$(this).find('i').removeClass('down').addClass('up');
		}else {
			$(this).find('i').removeClass('up').addClass('down');
			$(this).removeClass('on');
		}
				
		return false;
	})
	
});