// PC
var body_w = $(window).outerWidth(true);
var body_h = $(window).outerHeight(true);
// animate 鍔ㄧ敾鏍峰紡
var $easing = ['linear', 'swing', 'easeInQuad', 'easeOutQuad', 'easeInOutQuad', 'easeInCubic', 'easeOutCubic', 'easeInOutCubic', 'easeInQuart', 'easeOutQuart', 'easeInOutQuart', 'easeInQuint', 'easeOutQuint', 'easeInOutQuint', 'easeInExpo', 'easeOutExpo', 'easeInOutExpo', 'easeInSine', 'easeOutSine', 'easeInOutSine', 'easeInCirc', 'easeOutCirc', 'easeInOutCirc', 'easeInElastic', 'easeOutElastic', 'easeInOutElastic', 'easeInBack', 'easeOutBack', 'easeInOutBack', 'easeInBounce', 'easeOutBounce', 'easeInOutBounce']
// 灞呬腑鏍峰紡
$('[middle="center"]').each(function(){$(this).children().wrapAll('
'); });
function auto_h(a){
a.children().css({
height: $(window).height() - $('.head_box').outerHeight(true) - $('.foot_box').outerHeight(true),
marginTop: $('.head_box').outerHeight(true)
})
}
auto_h($('#index_2'));
auto_h($('#index_3'));
auto_h($('#index_4'));
// if(!$('.head_box').hasClass('_index')){
// $('body').prepend('');
// }
if(!$('.foot_box').hasClass('_index')){
$('body').append('');
}
// banner
function Banner() {
var $box = $('.banner_box'),
$ul = $box.children(),
$li = $ul.children(),
s = $li.length,
i = 0,
speed = 2500,
Interval = 5000;
$li.first().show();
var t = setInterval(function(){
i++;
if(i > s - 1){
$li.first().stop().fadeIn(speed).siblings().stop().fadeOut(speed);
i = 0;
}
$li.eq(i).stop().fadeIn(speed).siblings().stop().fadeOut(speed);
},Interval);
}
Banner();
function NewTab(){
var tab = $('.new_tab').children(),
list = $('.new_list');
list.first().show();
tab.each(function(e){
$(this).hover(function(){
$(this).addClass('active').siblings().removeClass('active');
list.eq(e).stop().show().siblings('.new_list').stop().hide();
});
});
}
NewTab();
function ProWidth() {
var box_w = $('.p_pro_list ul li .p_pro_c').width();
$('.p_pro_list ul li').each(function(e) {
var img_w = $(this).find('.p_pro_img img').outerWidth(true);
// $(this).find('.p_pro_img').css({
// width: img_w
// });
// $(this).find('.p_pro_text').css({
// width: box_w - $(this).find('.p_pro_img').outerWidth(true) - 5
// });
$('.p_pro_menu').siblings('.p_pro_text').css({
width: box_w - 776
});
});
}
ProWidth();
function Display(){
var $list = $('.p_pro_list'),
$ul = $list.children(),
$li = $ul.children(),
$main = $li.children(),
$img = $main.children('.p_pro_img'),
$text = $main.children('.p_pro_text'),
s = $li.length,
speed = 800,
i = 0,
addStyle = 'addstyle';
$li.first().addClass('odd').addClass(addStyle);
$ul.children('li:nth-child(2n)').addClass('even').next().addClass('odd');
$(window).scroll(function(){
var h = $(window).scrollTop();
for (var i = 0;i < s; i++){
if(h >= $li.eq(i).offset().top - body_h + 100){
$li.eq(i).addClass(addStyle);
}
if(h <= $li.eq(i).offset().top - body_h){
$li.eq(i).removeClass(addStyle);
}
}
});
}
Display();
function NewSwitch(){
var $box = $('.p_new_switch'),
$list = $('.new_switch_list'),
$ul = $list.children(),
$li = $ul.children(),
$ico = $('.new_ico'),
w = $box.width(),
i = 0,
c = 'active',
s = $li.length,
interval = 4000,
speed = 300;
$li.width(w);
$ul.width(w * (s + 1)).append($li.first().clone());
for (var j = 0; j < s; j++) {
var add_a = '';
$ico.append(add_a);
}
var $ico_c = $ico.children();
$ico_c.first().addClass(c);
$ico_c.each(function(e){
$(this).click(function(){
if(!$ul.is(':animated')){
i = e;
$(this).addClass(c).siblings().removeClass(c);
$ul.stop().animate({marginLeft: -e * w }, speed);
}
});
});
var t = setInterval(Move, interval);
function Move(){i++; if (i > s) {$ul.css({marginLeft: 0 }); i = 1; } if (i >= s) {$ico_c.first().addClass(c).siblings().removeClass(c); } $ul.stop().animate({marginLeft: -i * w }, speed); $ico_c.eq(i).addClass(c).siblings().removeClass(c); }
$box.hover(function(){clearInterval(t); },function(){t = setInterval(Move, interval); });
}
NewSwitch();
function SlidebarMenu(){
var $list = $('.slidebar_list'),
$ul = $list.children(),
$li = $ul.children(),
c = 'active';
$li.children('a.active').siblings().show();
$li.each(function(e){
$(this).find('ul').siblings().attr('href','javascript:;');
$(this).find('a').click(function(){
$(this).addClass(c).parent().siblings().children('a').removeClass(c);
$(this).siblings().stop().slideToggle(300).paren().siblings().children('ul').stop().slideUp(300);
});
});
}
SlidebarMenu();
// 鎵嬫満鐗 鐗规晥
function NavShow() {
var $btn = $('.nav_btn'),
$nav = $('.nav_box'),
$close = $nav.find('.close'),
$list = $('.nav_list'),
$ul = $list.children(),
$li = $ul.children(),
$mask = $('.nav_mask'),
c = 'active',
speed = 300;
$li.find('a.active').siblings().show();
$btn.click(function(){$nav.stop().animate({right: 0 }, speed); $mask.stop().fadeIn(300); });
$close.click(function(){$nav.stop().animate({right: '-70%'}, speed); $mask.stop().fadeOut(300); });
$mask.click(function(){$nav.stop().animate({right: '-70%'}, speed); $(this).stop().fadeOut(300); });
$li.each(function(e) {
$(this).find('ul').siblings('a').attr("href", "javascript:;");
$(this).find('a').click(function() {
if ($(this).siblings('ul').unbind('click').is(':hidden')) {
$(this).addClass(c).parent().siblings().children('a').removeClass(c);
$(this).siblings('ul').stop().slideDown(300).parents('li').siblings('li').children('ul').stop().slideUp(300);
} else {
$(this).removeClass(c);
$(this).siblings('ul').stop().slideUp(300);
}
});
});
}
NavShow();
// 鎵嬫満鐗堝垎椤靛脊鍑
function ListNav(){
var $show_btn = $('.list_show'),
$list_nav = $('.list_nav'),
$close = $('.list_close');
$show_btn.click(function(){
$('html,body').css({overflow: 'hidden'});
$list_nav.stop().fadeIn(300);
});
$close.click(function(){
$('html,body').css({overflow: ''});
$list_nav.stop().fadeOut(300);
});
}
ListNav();
// 鏃犲埛鏂版嫑鑱樺姞杞
$('.recruits').on('click',function(){
var num = $(this).data('num');
if( Number(num) && !num ){
layer.msg('鏍忕洰鑾峰彇澶辫触');
return false
}
$.ajax({
type: "GET",
dataType: "json",
url:"ajax_check.php?action=recruit&id="+num,
success: function (result)
{
if(result.code == 100)
{
$('.p_join_box').html(result.data.cn_content)
$('.jobs_cont').text(result.data.cn_title)
}
else
{
layer.msg(result.message);
}
},
error : function(XMLHttpRequest, textStatus, errorThrown)
{
layer.msg('鏌ヨ鎺ュ彛閿欒鎴栫郴缁熺箒蹇?,{anim: 0,time: 2000},function(){
});
}
});
})
$(document).ready(function() {
"use strict";
// 鍒ゆ柇娴忚鍣ㄦ槸鍚︽敮鎸 placeholder
if (!placeholderSupport()) {$('[placeholder]').focus(function() {var input = $(this); if (input.val() == input.attr('placeholder')) {input.val(''); input.removeClass('placeholder'); } }).blur(function() {var input = $(this); if (input.val() == '' || input.val() == input.attr('placeholder')) {input.addClass('placeholder'); input.val(input.attr('placeholder')); } }).blur(); };
})
function placeholderSupport() {return 'placeholder' in document.createElement('input'); }