//=== viewid:dh_style_01_1528703354992,dh_style_11_1530850445645 ===//
/*pc,手机显示隐藏*/
function is_mobile(){
return window.screen.width<767 || ($('body').width() > 0 && $('body').width() < 767);
}
var is_mobile_boolean = is_mobile();
$(function(){
/*pc,手机显示隐藏*/
})
//=== viewid:lang_style_1_1528956310183 ===//
$(document).ready(function(){
});
//=== viewid:dh_style_11_1530850445645 ===//
function navSwtich(obj) {
$(obj).siblings(".menuUlCopy").slideToggle(200);
$(obj).toggleClass('ontoggle');
$(obj).parent().siblings().find(".menuUlCopy").slideUp(200);
$(obj).parent().siblings().find(".fa-angle-down").removeClass('ontoggle');
}
function subLeft_dh_style_11_1530850445645(){
$("#dh_style_11_1530850445645 .menuUl>li").each(function(){
$(this).find(".menuUl03").css("left",'100%');
})
}
$(window).resize(function() {
subLeft_dh_style_11_1530850445645();
})
$(function(){
$("#dh_style_11_1530850445645 .fa-navicon").click(function(){
$("#dh_style_11_1530850445645").addClass('clearTransform');
$("#dh_style_11_1530850445645 .menuUlCopy").each(function(){
$(this).siblings(".fa").show();
})
})
subLeft_dh_style_11_1530850445645();
$("#dh_style_11_1530850445645 .subBox").css("top",$("#dh_style_11_1530850445645 .menuUl_box").height());
if($("#dh_style_11_1530850445645 .menuUl").hasClass("noHover")){
var tabNum = 0;
$("#dh_style_11_1530850445645 .menuUl>li").find(".Onsub").each(function(){
tabNum += 1;
$(this).parent().attr("tabNum",tabNum)
})
$("#dh_style_11_1530850445645 .menuUl>li .Onsub").mouseover(function(){
$("#dh_style_11_1530850445645 .subBox").show();
var index = $(this).parent().attr("tabNum");
$("#dh_style_11_1530850445645 .subBox .subItems").eq(index-1).fadeIn(100).siblings().hide();
$("#dh_style_11_1530850445645 .subBox .subMenuImgArea .subMenuImgCon").eq(0).fadeIn(100).siblings().hide();
})
$("#dh_style_11_1530850445645 .subBox").mouseleave(function(){
$(this).hide();
});
$("#dh_style_11_1530850445645 .menuUl>li .Nosub").mouseover(function(){
$("#dh_style_11_1530850445645 .subBox").hide();
})
//风格41 42
}
})
//=== viewid:homelink_style_01_1486374044927 ===//
//=== viewid:dh_style_menu2_01_1486432394649 ===//
// 风格style_menu2_03 交互
//=== viewid:image_style_04_1526629527067 ===//
function phSize(){
$("#image_style_04_1526629527067 li").each(function(){
var img_W = $(this).find("img").width();
var img_H = $(this).find("img").height();
if(img_W < img_H){
$(this).find("img").css({"width":"100%","height":"auto"});
}else{
$(this).find("img").css({"width":"auto","height":"100%"});
}
});
}
//=== viewid:image_style_04_1526629527067 ===//
$(function(){
var obj = $("#image_style_04_1526629527067");
var picItems = obj.find("li.imgItems");
var num = 0;
var picBox;
picItems.click(function(){
var topH = $(window).scrollTop();
var index = $(this).index();
var curPic = $(this).find("img").attr("src");
num = index;
var picBoxhtml = $("
");
//"+""+"为了躲开图片延时加载的代码替换
$("body").append(picBoxhtml);
picBox = $(".imgShowBox");
pdSize();
//判断下一张和上一张按钮的显示
if(picItems.length == 1){
$("body").find(".imgButton>.nextImg,.imgButton>.prevImg").css("visibility","hidden")
}
if(picItems.length-1 == $(this).index()){
$("body").find(".imgButton>.nextImg").css("visibility","hidden")
}
if($(this).index() == 0){
$("body").find(".imgButton>.prevImg").css("visibility","hidden")
}
//关闭
$("body").find(".imgButton>.closeShowPic").click(function(){
$(".imgShowBox").remove();
$("body").removeClass("pos_fixed");
$(window).scrollTop(topH);
});
//下一张
$("body").find(".imgButton>.nextImg").click(function(){
$(".imgShowBox img").css("max-height","none");
var len = obj.find("li:has('img')").length;
$(this).siblings().css("visibility","visible");
num++;
if(num >= len){
num = len-1;
}
if(num == len-1){
$(this).css("visibility","hidden");
}
curPics();
pdSize();
});
//上一张
$("body").find(".imgButton>.prevImg").click(function(){
$(".imgShowBox img").css("max-height","none");
$(this).siblings().css("visibility","visible");
num--;
if(num <= 0){
num = 0;
$(this).css("visibility","hidden");
}
curPics();
pdSize();
});
});
//切换大图
function curPics(){
var newImg = obj.find("li").eq(num).find("img").attr("src");
picBox.find("img").attr("src",newImg);
}
//判断展开显示效果
function pdSize(){
var imgH = picBox.find("img").height();
var winH = $(window).height();
if(imgH>winH){
$("body").addClass("pos_fixed");
picBox.addClass("scroll");
picBox.animate({"scrollTop":"0px"},200);
}else{
$("body").removeClass("pos_fixed");
picBox.removeClass("scroll");
$(".imgShowBox img").css("max-height","80%");
}
}
//遍历所有图片宽高定位
picItems.each(function(){
var img_W = $(this).find("img").width();
var img_H = $(this).find("img").height();
if(img_W < img_H){
$(this).find("img").css({"width":"100%","height":"auto"})
}else{
$(this).find("img").css({"width":"auto","height":"100%"})
}
});
});
//=== viewid:searchbox_style_01_1486950341460 ===//
$("#searchbox_style_01_1486950341460 .search-btn").click(function(){
var kw=$("#searchbox_style_01_1486950341460 .search_input").val();
var gourl = $(this).attr("attrhref");
href = gourl+(gourl.indexOf('?')>-1?'&':'?')+"pkeyword="+kw;
location.href = href;
})
function searchOne(lname){
var gourl = $(lname).attr("attrhref");
href = gourl+(gourl.indexOf('?')>-1?'&':'?')+"pkeyword="+$(lname).html();
location.href = href;
}
$("#searchbox_style_01_1486950341460 .search_input").val(decodeURIComponent(Request("pkeyword")));
function goSearch(form) {
console.log('form: ', form);
$(form).find('.search-btn').trigger('click');
return false;
}
//=== viewid:share_style_03_1525922520212 ===//
setTimeout(function () {
$(function() {
$("#share_style_03_1525922520212 .shareImage").proSocialShare({
content: '',
url:window.location.href,
title:document.title,
viewid:"#share_style_03_1525922520212"
});
});
}, 1000);
// 分享微信
function showWeiXin(a) {
$(a).parent().find('.wechat_qrcode').toggle();
}