www.gusucode.com > (自适应手机版)html5响应式外贸网站源码 英文版化妆美容产品网站织梦模板(demo414)源码程序 > (自适应手机版)html5响应式外贸网站源码 英文版化妆美容产品网站织梦模板(demo414)源码程序/www3/skin/js/main.js

    $(function (){

	$("nav ul li ul li a,.nav ul li ul li a").prepend("<b>&gt;&nbsp;&nbsp;&nbsp;</b>");
	$("nav ul li ul li a,.nav ul li ul li a").append("<b class='r'>&nbsp;&nbsp;&nbsp;&lt;</b>");

	$('.header .search').click(function(){
		$('.nav').css('left','100%');
		$('.header_menu').removeAttr('id');
		if($(this).attr('id')!='click'){
			$(this).attr('id','click');
			$('.search_moblie').slideDown();
		}else{
			$(this).removeAttr('id');
		$('.search_moblie').slideUp();
		}
	})
	$('.header_menu').click(function(){
		$('.search_moblie').hide();
		$('.header .search').removeAttr('id');
		if($(this).attr('id')!='menuClick'){
			$(this).attr('id','menuClick');
			$('.nav').css('left','0');
		}else{
			$(this).removeAttr('id');
			$('.nav').css('left','100%');
		}
	})
	$('#bottom .ul_1 h4').click(function(){
		$(this).siblings('div').toggle('slow');
		if($(this).children('span').attr('class')=='active'){
			$(this).children('span').removeClass();
		}else{
			$(this).children('span').attr('class','active');
		}
	})
	$('#bottom .ul_3 h4').click(function(){
		$(this).siblings('div').toggle('slow');
		if($(this).children('span').attr('class')=='active'){
			$(this).children('span').removeClass();
		}else{
			$(this).children('span').attr('class','active');
		}
	})
	 $('.nav ul li span').click(function(){
		if($(this).attr('class')!='active'){
			$(this).siblings('ul').slideDown();	 
			$(this).attr('class','active');
			$(this).parent().siblings('li').children('ul').slideUp();
			$(this).parent().siblings('li').children('span').removeClass();
		}else{
			$(this).siblings('ul').slideUp();	 
			$(this).removeClass();
		}
	 })

	
 	$('nav ul li').find('a').mouseover(function(){
 		$(this).parent().find('ul').css('top','26px');
 		$(this).parent().find('ul').css('opacity','1');
 	})
 	$('nav ul li').mouseleave(function(){
 		$(this).parent().find('ul').css('top','100px');
 		$(this).parent().find('ul').css('opacity','0');
 	})
});


//Email format
function is_email(str)
{ if((str.indexOf("@")==-1)||(str.indexOf(".")==-1))
{
return false;
}
return true;
}

//feedback
function chkfeedback(form1){
if(form1.title.value==""){
alert("Please enter title!");
form1.title.focus();
return false;
}
if(form1.name.value==""){
alert("Please enter your name!");
form1.name.focus();
return false;
}
if(form1.tel.value==""){
alert("Please enter your phone number!");
form1.tel.focus();
return false;
}
if(form1.email.value==""){
alert("Please enter your email address!");
form1.email.focus();
return false;
}
if(!is_email(form1.email.value))
{ alert("The mailbox is malformed!");
form1.email.focus();
return false;
}

if(form1.CompanyName.value==""){
alert("Please enter your company name!");
form1.CompanyName.focus();
return false;
}

if(form1.content.value==''){
alert("Please enter your content!");
form1.content.focus();
return false;
}

return true;
}
//end


//clickcount
function showNum(cid,ctype,cshow,showid){
	$.get('/config/count.asp',{id:cid,stype:ctype,show:cshow},function(data){
		$(showid).html(data);
	});
}