// javascript document
//按需写入所需的函数名
$(function(){
//gotop();
gszl();
animate();
style();
retop();
$(".nav ul li").hover(function(){
$(this).children("a").addclass("cur");
$(this).children("dl").stop(true,true).slidedown();
},function(){
$(this).children("a").removeclass("cur");
$(this).children("dl").stop(true,true).slideup();
})
$(".banner .word1,.banner .word2").addclass("fil");
$(".indexnewslist li").each(function(i){
settimeout(function(){
$(".indexnewslist li").eq(i).addclass("fir");
},i*400);
});
$(".rnewslist li").each(function(i){
settimeout(function(){
$(".rnewslist li").eq(i).addclass("fir");
},i*400);
});
$(".newslist li").each(function(i){
settimeout(function(){
$(".newslist li").eq(i).addclass("fir");
},i*400);
});
$(".history-date li:even").find(".historydialog").addclass("p_fr");
$(".history-date li:odd").find(".historydialog").addclass("p_fl");
systole();
$(".relbox").each(function(i){
settimeout(function(){
$(".relbox").eq(i).addclass("fiu");
},i*400);
});
$(".jobslist li").each(function(i){
settimeout(function(){
$(".jobslist li").eq(i).addclass("fiu");
},i*400);
});
})
//公司冶理效果
function gszl()
{
$('.gszl_content')
.css( {backgroundposition: "0 0"} )
.mouseover(function(){
$(this).stop().animate({backgroundposition:"(0 -272px)"}, {duration:1500})
})
.mouseout(function(){
$(this).stop().animate({backgroundposition:"(0 0)"}, {duration:1500})
})
}
//回到顶部
function gotop(){
var $backtotoptxt = "ss",
$backtotopele = $("").appendto($("body")).text($backtotoptxt).attr("title", $backtotoptxt).click(function() {
$("html, body").animate({
scrolltop: 0
},300);
}),
$backtotopfun = function() {
var st = $(document).scrolltop(),
winh = $(window).height(); (st > 0) ? $backtotopele.show() : $backtotopele.hide();
//ie6下的定位
if (!window.xmlhttprequest) {
$backtotopele.css("top", st + winh - 166);
}
};
$(window).bind("scroll", $backtotopfun);
$(function() {
$backtotopfun();
});
}
//样式微调——自行扩展增删
function style(){
$(".oneboxinfo .imglink,.aboutslideinfobox .imglink,.introinfo a,.newslist li .piclink,.recommanbox .piclink,.projectsbox li a").hover(function(){
$(this).find("img").css("opacity",0.7);
},function(){
$(this).find("img").css("opacity",1);
});
$(".dynamics li:last,.jobsmenu li:last,.jobslist li:last").css("border","none");
}
//表单相关
function forms(){
//输入框文字清空还原,控制value
//
$(".deasearch .inp").focus(function(){
if($(this).val() ==this.defaultvalue){
$(this).val("");
}
}).blur(function(){
if ($(this).val() == '') {
$(this).val(this.defaultvalue);
}
});
}
//动画相关
function animate(){
$(".sidebanner .aboutword").animate({
"margin-right":0
/*"opacity":1*/
},1500);
$(".sidebanner .rpbword").animate({
"margin-left":"-207px"
/*"opacity":1*/
},1500);
$(".sidebanner .relaword,.sidebanner .newsword,.sidebanner .businessword").animate({
"margin-top":0
/*"opacity":1*/
},1500);
$(".sidebanner .jobsword").animate({
"margin-left":0
/*"opacity":1*/
},1500);
}
//回到顶部
function retop(){
$(window).scroll(function(){
if($(this).scrolltop()>200)
{
$(".retop .retopbtn").stop(true,true).fadein();
}
else
{
$(".retop .retopbtn").stop(true,true).fadeout();
}
});
$(".retopbtn").click(function(){
$("html,body").animate({
scrolltop:0
},400);
});
}
//发展历程
function systole() {
if (!$(".history").length) {
return;
}
var $warpele = $(".history-date"),
parenth,
eletop = [];
parenth = $warpele.parent().height();
$warpele.parent().css({
"height":0
});
settimeout(function () {
$warpele.find("ul").each(function (idx) {
eletop.push($(this).position().top);
$(this).css({
"margin-top":-eletop[idx]
}).children().hide();
}).animate({
"margin-top":0
}, 1600).children().fadein();
$warpele.parent().animate({
"height":parenth
}, 2600);
$warpele.find("ul").addclass("bounceindown").css({
"-webkit-animation-duration":"2s",
"-webkit-animation-delay":"0",
"-webkit-animation-timing-function":"ease",
"-webkit-animation-fill-mode":"both",
"-moz-animation-duration":"2s",
"-moz-animation-delay":"0",
"-moz-animation-timing-function":"ease",
"-moz-animation-fill-mode":"both",
"animation-duration":"2s",
"animation-delay":"0",
"animation-timing-function":"ease",
"animation-fill-mode":"both"
}).end();}, 600);
}