$(document).ready(function() {
"use strict";
layui.use(["form", "layer"], function()
{
var layer = layui.layer;
var form = layui.form;
form.render();
//动画
new WOW().init();
//控制在线客服
$(function(){
var $body = $(document.body);;
var $bottomTools = $('.bottom_tools');
var $qrGuide = $('.cl_kefubtn_2');
var $qrGuide_en = $('.cl_kefubtn_2_en');
var $qrGuide_1 = $('.cl_kefubtn_3');
var $qrTools = $('.cl_kefubtn_4');
var $qrTools_en = $('.cl_kefubtn_4_en');
var qrImg = $('.qr_img');
var qrImg_en = $('.qr_img_en');
var qrMenu = $('.qr_menu');
var qrMenu_1 = $('.qr_menu_1');
$(window).scroll(function () {
var scrollHeight = $(document).height();
var scrollTop = $(window).scrollTop();
var $footerHeight = $('.page-footer').outerHeight(true);
var $windowHeight = $(window).innerHeight();
if(scrollTop > 50)
{
$("#cl_gotop").fadeIn(200).css("display","block");
$(".cl_kefubtn_4").removeClass("go_radius_2");
}
else
{
$(".cl_kefubtn_4").addClass("go_radius_2");
$("#cl_gotop").fadeOut(200);
}
$bottomTools.css("bottom", scrollHeight - scrollTop - $footerHeight > $windowHeight ? 185 : $windowHeight + scrollTop + $footerHeight + 185 - scrollHeight);
});
$('#cl_gotop').click(function (e) {
e.preventDefault();
$('html,body').animate({ scrollTop:0});
});
$qrTools.hover(function () {
qrImg.fadeIn(0);
}, function(){
qrImg.fadeOut(0);
});
$qrTools_en.hover(function () {
qrImg_en.fadeIn(0);
}, function(){
qrImg_en.fadeOut(0);
});
$qrGuide.hover(function () {
qrMenu.fadeIn(0).css("display","block");
}, function(){
qrMenu.fadeOut(0);
});
$qrGuide_en.hover(function () {
qrMenu.fadeIn(0).css("display","block");
}, function(){
qrMenu.fadeOut(0);
});
$qrGuide_1.hover(function () {
qrMenu_1.fadeIn(0).css("display","block");
}, function(){
qrMenu_1.fadeOut(0);
});
});
form.on("submit(feed_submit)", function(data){
$.ajax({
type: "POST",
dataType: "json",
url: "ajax_api.php?action=feedback",
data: $("#feed_form").serialize(),
success: function (result)
{
if (result.code == 200)
{
layer.msg(result.message,{anim: 0,time: 2000},function(){window.location.reload();});
}
else
{
$("#refresh").attr("src","code_"+Math.random()+".html");
$("#cl_code").val("");
layer.msg(result.message);
}
},
error : function()
{
layer.msg("接口繁忙请稍后重试");
}
});
return false;
});
});
var body_w = $(window).outerWidth(true);
// animate 动画样式
var bStyle = new Array("cubeSpread", "glassCube", "cubeStop", "paralell", "cubeSize", "swapBarsBack", "cut", "cubeRandom", "tube");
// 居中样式
$('[middle="center"]').each(function(){$(this).children().wrapAll('
'); });
// 等比例样式
window.onload = function() {$('[ratio]').each(function() {var $ratio = $(this).attr('ratio'), $ratio_w = parseInt($ratio.split(":")[0]), $ratio_h = parseInt($ratio.split(":")[1]), $width = $(this).width(); $(this).height($width * ($ratio_h / $ratio_w)); }); }
$(window).resize(function() {$('[ratio]').each(function() {var $ratio = $(this).attr('ratio'), $ratio_w = parseInt($ratio.split(":")[0]), $ratio_h = parseInt($ratio.split(":")[1]), $width = $(this).width(); $(this).height($width * ($ratio_h / $ratio_w)); }); });
// Banner
var swiper_banner = new Swiper('.banner_box', {
pagination: '.ico_c',
paginationClickable: true
});
// 首页 新闻中心
var swiper = new Swiper('.new_switch', {
pagination: '.new_spot',
paginationClickable: true,
spaceBetween: 20,
nextButton: '.swiper-button-next',
prevButton: '.swiper-button-prev',
autoHeight: true
});
// 0029cc金沙贵宾会
function Roll(box) {
var one = box.children(),
n = one.length,
w = one.first().outerWidth(true),
i = 0,
speed = 25; /*滚动速度*/
box.width(n * 2 * w + w).append(one.clone());
var t = setInterval(Move, speed);
function Move() {i++; if (i >= n * w) {i = 1; } box.stop(true).animate({left: -i }, 1); }
one.mouseover(() => {clearInterval(t); });
one.mouseout(() => {t = setInterval(Move, speed); });
}
Roll($('.abo_menu'));
// 产品详情 轮播图
var swiper = new Swiper('.pro_switch', {
nextButton: '.swiper-button-next',
prevButton: '.swiper-button-prev',
autoHeight: true,
paginationClickable: true,
autoplay: 4500
});
// 产品详情 切换
var swiper_details = new Swiper('.pro_d_box', {
speed: 500,
spaceBetween: 20,
autoHeight: true,
onSlideChangeStart: function(swiper) {
$(".pro_d_tab span.active").removeClass('active');
$(".pro_d_tab span").eq(swiper.activeIndex).addClass('active');
}
});
$(".pro_d_tab span").on('touchstart click', function(e) {
e.preventDefault();
$(".pro_d_tab span.active").removeClass('active');
$(this).addClass('active');
swiper_details.slideTo($(this).index());
});
// 内页 招聘
function pageJobs(){
var list = $('.jobs_list'),
li = list.children(),
title = li.children('.title'),
text = li.children('.text');
title.each(function(e) {
title.click(function() {
$(this).siblings().stop().slideDown(500).parent().siblings().children('.text').stop().slideUp(300);
});
});
}
pageJobs();
// 手机端语言
function LangShow(){
var btn = $('.lang_c'),
box = $('.lang_box'),
close = box.find('.close');
close.click(function (e) {box.hide();});
btn.click(function (e) {box.fadeIn(200);});
}
LangShow();
// Nav Show
function NavShow() {
var dBox = $('.nav_c'),
dNav = $('.nav_box'),
close = dNav.find('.close'),
list = $('.nav_list'),
ul = list.children(),
li = ul.children(),
mask = $('.mask'),
c = 'active',
speed = 300;
li.find('a.active').siblings().show();
dBox.click(function(){dNav.stop().animate({left: 0 }, speed); mask.stop().fadeIn(300); });
close.click(function(){dNav.stop().animate({left: '-80%'}, speed); mask.stop().fadeOut(300); });
mask.click(function(){dNav.stop().animate({left: '-80%'}, 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();
});
$(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'); }