$(function(){
$(".child1").hover(function(){
$(this).css("border-bottom","3px solid #e80033");
$(".sub_nav_ul",this).slideDown(500);
},function(){
$(this).css("border-bottom","3px solid #FFF");
$(".sub_nav_ul",this).slideUp(500);
});
var id=$("#typeid").attr("value");
$("#li"+id).css("background","url(./Apps/Tpl/default/Public/images/type_hover.png) no-repeat");
$("#li"+id+" a").css("color","#FFF");
$("#ali"+id).css("background","url(./Apps/Tpl/default/Public/images/06.png) center no-repeat");
$("#ali"+id+" a").css("color","#FFF");
})
//
$(function(){
$("#case_index ul li h3 img").hover(function(){
var id=$(this).attr("id");
$(this).attr("src","./Apps/Tpl/default/Public/images/"+id+"_hover.png");
},function(){
var id=$(this).attr("id");
$(this).attr("src","./Apps/Tpl/default/Public/images/"+id+".png");
});
})
//首页解决方案切换
$(function() {
var sWidth = $("#hot_list").width(); //获取焦点图的宽度(显示面积)
var len = $("#hot_list ul li").length; //获取焦点图个数
var index = 0;
var picTimer;
//以下代码添加数字按钮和按钮后的半透明条,还有上一页、下一页两个按钮
var btn = "
";
for(var i=0; i < len; i++) {
btn += "";
}
$("#hot_list").append(btn);
$("#hot_list .btnBg").css("opacity","1");
//为小按钮添加鼠标滑入事件,以显示相应的内容
$("#hot_list .btn span").css("opacity","1").click(function() {
index = $("#hot_list .btn span").index(this);
showPics(index);
}).eq(0).trigger("mouseover");
//上一页、下一页按钮透明度处理
$("#hot_list .preNext").css("opacity",0.2).hover(function() {
$(this).stop(true,false).animate({"opacity":"0.5"},300);
},function() {
$(this).stop(true,false).animate({"opacity":"0.2"},300);
});
//上一页按钮
$("#hot_list .pre").click(function() {
index -= 1;
if(index == -1) {index = len - 1;}
showPics(index);
});
//下一页按钮
$("#hot_list .next").click(function() {
index += 1;
if(index == len) {index = 0;}
showPics(index);
});
//本例为左右滚动,即所有li元素都是在同一排向左浮动,所以这里需要计算出外围ul元素的宽度
$("#hot_list ul").css("width",sWidth * (len));
//鼠标滑上焦点图时停止自动播放,滑出时开始自动播放
$("#hot_list").hover(function() {
clearInterval(picTimer);
},function() {
picTimer = setInterval(function() {
showPics(index);
index++;
if(index == len) {index = 0;}
},2000); //此4000代表自动播放的间隔,单位:毫秒
}).trigger("mouseleave");
//显示图片函数,根据接收的index值显示相应的内容
function showPics(index) { //普通切换
var nowLeft = -index*sWidth; //根据index值计算ul元素的left值
$("#hot_list ul").stop(true,false).animate({"left":nowLeft},300); //通过animate()调整ul元素滚动到计算出的position
//$("#hot_list .btn span").removeClass("on").eq(index).addClass("on"); //为当前的按钮切换到选中的效果
$("#hot_list .btn span").stop(true,false).css("background","#dddddd").eq(index).stop(true,false).css("background","#e6002d"); //为当前的按钮切换到选中的效果
}
});
//banner
$(document).ready(function(){
$('#slider').nivoSlider({
effect:'random',
slices:15,
animSpeed:500,
pauseTime:2000,
directionNav:true,
controlNav:true,
keyboardNav:true
});
});
$(function() {
$("#gallery a").lightBox();
});
$(function(){
$("#us_zs ul li").click(function(){
$("a",this).click();
})
$("#us_td ul li").click(function(){
$("a",this).click();
})
})
//人才招聘
$(function(){
$(".jobmeg").click(function(){
var id=$(this).attr("id");
$("#jobmeg"+id).slideToggle(300);
})
});
//留言
$(function(){
$(".reset").click(function(){
$(".texts").attr("value"," ");
$("#content").attr("value"," ");
})
})
//产品详情
$(function(){
//默认状态下左右滚动
$("#s1").xslider({
unitdisplayed:3,
movelength:1,
unitlen:80,
autoscroll:2000
});
$(".simg").click(function(){
var imgurl=$(this).attr("src");
//alert(imgurl);
$("#pro_img_left img").attr("src",imgurl);
});
$("#megtitle li").click(function(){
var id=$(this).attr("id");
for(var i=1;i<=4;i++){
if(i==id){
$("#meg"+i).css("display","block");
$("#"+i).css("background","url(./Apps/Tpl/default/Public/images/conlibg_hover.png) center no-repeat");
}else{
$("#meg"+i).css("display","none");
$("#"+i).css("background","url(./Apps/Tpl/default/Public/images/conlibg.png) center no-repeat");
}
}
})
})