// 鐣欒█鎻愪氦鎴愬姛鍚 鍊掕鏃
var t = 60;
function showTime(item){
item ? item : item = '#submit_message';
t -= 1;
$(item).text('鎻愪氦鎴愬姛锛?+t+'锛?);
$('#submit_message').css("pointer-events","none").css("background-color","#4CAF50").css("border","1px solid #4caf4f").css("color","#fff")
var f = setTimeout("showTime('"+item+"')",1000);
if(t==0){
window.location.reload(); //鍒锋柊褰撳墠椤甸潰
//$(item).text('鎻愪氦鐣欒█');
//$('#submit_message').css("pointer-events","auto")
//window.clearTimeout(f);
t=60;
}
}
(function( $ ){
$(document).ready(function() {
//骞荤伅鐗
/*$(window).load(function() {
$("#responsive-309391").carouFredSel({
responsive: true,
width : '100%',
items : { visible: 1 },
auto : { pauseOnHover: true, timeoutDuration:5000 },
swipe : { onTouch:true, onMouse:true },
pagination : "#carousel-page-309391",
prev : { button:function() { return $(this).parent().next('.carousel-direction').find(".carousel-prev"); }},
next : { button:function() { return $(this).parent().next('.carousel-direction').find(".carousel-next"); }}
});
$("#responsive-309391 .carousel-item").show()
});*/
//骞荤伅鐗
$(function(){
$('#responsive-309391').owlCarousel({
items: 1,
itemsDesktop : [1000,1],
itemsDesktopSmall : [900,1],
itemsTablet: [600,1],
itemsMobile : [479,1],
autoPlay:true,
pagination:true,
navigation: true,
navigationText: ["",""]
});
});
//浜у搧椤甸潰
$(function(){
$('#produc-slider').owlCarousel({
items: 1,
autoPlay:3000,
pagination:true,
autoHeight: true,
navigation: false,
});
});
//鑿滃崟
$(document).ready(function() {
$(".touch-toggle a").click(function(event) {
var className = $(this).attr("data-drawer");
if ($("." + className).css('display') == 'none') {
$("." + className).slideDown().siblings(".drawer-section").slideUp()
} else {
$(".drawer-section").slideUp()
}
event.stopPropagation()
});
$('.touch-menu a').click(function() {
if ($(this).next().is('ul')) {
if ($(this).next('ul').css('display') == 'none') {
$(this).next('ul').slideDown();
$(this).find('i').attr("class", "touch-arrow-up")
} else {
$(this).next('ul').slideUp();
$(this).next('ul').find('ul').slideUp();
$(this).find('i').attr("class", "touch-arrow-down")
}
}
})
});
$('.touch-menu .menu-item-has-children>a').attr('href','javascript:;');
//闂瓟婊氬姩鍒楄〃
$(function() {
$("#rolling_demo_onePage268793").carouFredSel({
height: 340,
auto: {
duration: 8000,
easing: "linear",
pauseDuration: 1
},
scroll: {
easing: 'linear',
pauseOnHover: 'immediate'
}
}).trigger("configuration", ["direction", "up"]).css("width", "100%")
});
//鍐呭鍔犺浇鍚庣殑杩愬姩鏁堟灉
if(xintheme.data_animate == 'true'){
dataAnimate();
}
//杩斿洖椤堕儴
function goTop(){
$(window).scroll(function(e) {
if($(window).scrollTop()>100)
$(".gotop").fadeIn(350).css("display","block");
else
$(".gotop").fadeOut(350).css("display","none");
});
$(".gotop").click(function(e) {
$('body,html').animate({scrollTop:0},500);
return false;
});
};
goTop();
//scrollable-default
$(".scrollable-default").carouFredSel({
width : '100%',
infinite : false,
//circular : false,
auto : { pauseOnHover: true, timeoutDuration:3500 },
swipe : { onTouch:true, onMouse:true },
prev : { button:function() { return $(this).parent().next('.carousel-direction').find(".carousel-prev"); }},
next : { button:function() { return $(this).parent().next('.carousel-direction').find(".carousel-next"); }}
});
$(".scrollable-default").parents(".scrollable").css("overflow","visible");
//浜у搧杞挱
$(".full-scrollable-default").carouFredSel({
infinite : false,
circular : false,
auto : false,
swipe : { onTouch:true, onMouse:true },
responsive : true,
items : {
visible : {
min : 2,
max : 8
}
},
prev : { button:function() { return $(this).parent().next('.carousel-direction').find(".carousel-prev"); }},
next : { button:function() { return $(this).parent().next('.carousel-direction').find(".carousel-next"); }}
});
//閲嶇疆楂樺害
$(".full-scrollable-default").parents('.caroufredsel_wrapper').css({
'height': ($(".full-scrollable-default").find('li').outerHeight()) + 'px'
});
$('.popup-show-btn').click(function(){
$('.popup').show();
$('.popup-overlay').height($(document).height());
$('.popup-content').css({marginLeft:-($('.popup-content').outerWidth()/2), marginTop:-($('.popup-content').outerHeight()/2)});
$('.popup-close-btn').click(function(){
$(this).parents('.popup').hide();
});
return false;
});
//瀵艰埅鏍忎笅鎷夊浐瀹
$(window).scroll(function() {
if ($(window).scrollTop() > 190) {
$('.header-v4').addClass("sticky");
} else {
$('.header-v4').removeClass("sticky");
}
});
//鎼滅储
// Handle click on toggle search button
$('#toggle-search').click(function() {
$('#search-form, #toggle-search').toggleClass('open');
return false;
});
// Handle click on search submit button
$('#search-form input[type=submit]').click(function() {
$('#search-form, #toggle-search').toggleClass('open');
return true;
});
// Clicking outside the search form closes it
$(document).click(function(event) {
var target = $(event.target);
if (!target.is('#toggle-search') && !target.closest('#search-form').size()) {
$('#search-form, #toggle-search').removeClass('open');
}
});
//浜у搧涓績鑿滃崟
$(function(){
$(".produc-menu-children .controls li ul.children").parent().addClass("the-cat-parent");
//鎵嬫満绔 绉婚櫎浜岀骇鑿滃崟閾炬帴
var ua = navigator.userAgent;
var ipad = ua.match(/(iPad).*OS\s([\d_]+)/),
isIphone =!ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/),
isAndroid = ua.match(/(Android)\s+([\d.]+)/),
isMobile = isIphone || isAndroid;
if(isMobile){
$('.the-cat-parent>a').attr('href','javascript:;');
}
});
/* QQ */
jQuery('a.qq-share').click(function (e) {
e.preventDefault();
window.open('https://connect.qq.com/widget/shareqq/index.html?url=' + jQuery(this).attr('href') + '&title=' + jQuery(this).attr('data-title') + '&pics=' + jQuery(this).attr('data-image') + '&summary=' + jQuery(this).attr('data-excerpt'), "qqWindow", ["toolbar=0,status=0,resizable=1,width=640,height=560,left=", (screen.width - 640) / 2, ",top=", (screen.height - 560) / 2].join(""));
return false;
});
/* 寰俊 */
jQuery('a.weixin-share').click(function (e) {
e.preventDefault();
window.open( jQuery(this).attr('href'), "weixinWindow", ["toolbar=0,status=0,resizable=1,width=640,height=560,left=", (screen.width - 640) / 2, ",top=", (screen.height - 560) / 2].join(""));
return false;
});
/* 寰崥 */
jQuery('a.weibo-share').click(function (e) {
e.preventDefault();
window.open('https://service.weibo.com/share/share.php?url' + jQuery(this).attr('href') + '&type=button&language=zh_cn&title=' + '銆? + jQuery(this).attr('data-title') + '銆? + jQuery(this).attr('data-excerpt') + '&pic=' + jQuery(this).attr('data-image') + '&searchPic=true', "weiboWindow", ["toolbar=0,status=0,resizable=1,width=640,height=560,left=", (screen.width - 640) / 2, ",top=", (screen.height - 560) / 2].join(""));
return false;
});
/*fancybox*/
$(function() {
jQuery(".wp-block-gallery a").attr("data-fancybox","images");
jQuery(".wp-block-image a").attr("data-fancybox","images");
jQuery(".gallery-item a").attr("data-fancybox","images");
//jQuery('a[data-fancybox="images"]').fancybox();
});
/*ajax鐣欒█*/
$('#contact-form').submit(function(event) {
event.preventDefault();
$.ajax({
url: dahuzi.ajaxurl,
type: 'POST',
dataType: 'json',
data: $('#contact-form').serializeArray(),
})
.done(function( data ) {
if( data != 0 ){
if( data.state == 200 ){
$('#form-messages').removeClass('error').addClass('success').text(data.tips);
showTime('#submit_message');
}else if( data.state == 201 ){
$('#form-messages').removeClass('success').addClass('error').text(data.tips);
}
}else{
$('#form-messages').removeClass('success').addClass('error').text('璇锋眰閿欒锛?);
}
})
.fail(function() {
alert('缃戠粶閿欒锛?);
});
});
});
})( jQuery );
//澶撮儴鍏憡
if(xintheme.head_notice == 'true'){
window.onload = function(){
//澶撮儴鍏憡
if(getCookie("head-notice")==0){
document.getElementById("hellobar").style.cssText="margin-top:-56px;";
}else{
document.getElementById("hellobar").style.cssText="margin-top:0;";
}
}
//鍏抽棴澶撮儴鍏憡
function closeNotice() {
document.getElementById("hellobar").style.cssText="margin-top:-56px;";
setCookie("head-notice","0");
}
//璁剧疆cookie
function setCookie(name,value){
var exp = new Date();
//exp.setTime(exp.getTime() + 1*60*60*1000);//鏈夋晥鏈?灏忔椂
exp.setTime(exp.getTime() + 30*60*1000); //鏈夋晥鏈?0鍒嗛挓
document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
}
//鍙朿ookies鍑芥暟
function getCookie(name){
var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
if(arr != null) return unescape(arr[2]); return null;
}
}
//澶撮儴鍏憡 EDN
//寰俊寮瑰嚭灞
jQuery(document).ready(function($) {
$('.mobile_foot_menu_img').on('click', function() {
$('.mobile-foot-weixin-dropdown').toggleClass('is-visible');
});
$('.button_img').on('click', function() {
$('.button-img-dropdown').toggleClass('is-visible');
});
$(".close-weixin").on('click', function() {
$(".mobile-foot-weixin-dropdown").removeClass('is-visible');
$(".button-img-dropdown").removeClass('is-visible');
});
});