File: /www/wwwroot//m.wfehn.com/static/js/public.js
/*placeholder*/
$(document).ready(function () {
$(function () {
$('input, textarea').placeholder();
});
});
/*ie判断*/
function iePrompt() {
function createMent() {
var promptMent = "<div class='prompt'><span>您的浏览器版本也太低啦 !<br />赶快下载最新版的吧!推荐浏览器 : <a href='https://www.google.cn/chrome/' target='_blank'>Google浏览器</a></span> <b class='prompt_close'></b></div>";
$("body").append(promptMent);
$(".prompt").slideDown("slow");
$(".prompt_close,.prompt").click(function () {
$(".prompt").slideUp('300');
})
}
if (navigator.appName == "Microsoft Internet Explorer") {
var browser = navigator.appName
var b_version = navigator.appVersion
var version = b_version.split(";");
var trim_Version = version[1].replace(/[ ]/g, "");
var ua = window.navigator.userAgent;
if (ua.indexOf("Edge") >= -1 || ua.indexOf("edge") >= -1) {
$("body").attr("style", "font-family:'Microsoft YaHei', 'arial';")
}
if (trim_Version.indexOf("MSIE") >= -1) {
$("body").attr("style", "font-family:'Microsoft YaHei', 'arial';")
}
if (browser == "Microsoft Internet Explorer" && trim_Version == "MSIE6.0") {
createMent();
}
if (browser == "Microsoft Internet Explorer" && trim_Version == "MSIE7.0") {
createMent();
}
else if (browser == "Microsoft Internet Explorer" && trim_Version == "MSIE8.0") {
createMent();
}
}
}
iePrompt();
// search
$(document).ready(function () {
$(function () {
$("#search").click(function (e) {
e.stopPropagation();
})
$("#search-closed").click(function () {
$("#search-main").stop().slideUp({
duration: 300,
easing: "swing"
})
$("#search-btn").removeClass("active");
})
$("#search-btn").click(function (e) {
e.stopPropagation();
$(this).toggleClass("active");
$("#search-main").stop().slideToggle({
duration: 500,
// easing: "easeOutElastic"
})
})
$(".search-type").click(function (e) {
e.stopPropagation();
$("#search-type-chose").stop().slideToggle({
duration: 800,
// easing: "easeOutElastic"
})
})
$("#search-type-chose li").click(function () {
$(this).addClass("active").siblings().removeClass("active");
$("#search-type-this").text($(this).html());
$(this).parent().stop().hide();
$("#search-text").focus();
})
//
$(document).on("click", function () {
$("#search-type-chose,#search-main").hide();
$("#search-btn").removeClass("active");
});
})
});
$(document).ready(function() {
$("#menu li i").click(function() {
$(this).next().slideToggle().parent().siblings().children("ul").slideUp();
$(this).parent().toggleClass("active").siblings().removeClass("active");
});
});
$(function(){
$(".menu").click(function() {
$("#menu").addClass('show1');
})
$("#menu .close").click(function() {
$("#menu").removeClass('show1');
})
})
$(function() {
$(window).scroll(function(){
if($(window).scrollTop() > 20) {
$(".fix").addClass("headerFixed");
}else {
$(".fix").removeClass("headerFixed");
}
})
})
$(function(){
$(".float ul li:nth-child(3) a").click(function(){
$("html,body").animate({scrollTop:0},300);
});
})
function showPrivacyAgreement(){
$("#privacyPopup").show();
$(".translation").show();
$("#menu").removeClass('show1');
}
function hidePrivacyAgreement(){
$("#privacyPopup").hide();
$(".translation").hide();
}
function showPrivacyAgreement1(){
$("#privacyPopup1").show();
$(".translation").show();
$("#menu").removeClass('show1');
}
function hidePrivacyAgreement1(){
$("#privacyPopup1").hide();
$(".translation").hide();
}
$(document).ready(function(){
$(".trade02 .second-nav ul li").eq(0).addClass("active");
$(".trade02 .show .info").eq(0).show();
$(".trade02 .second-nav ul li").hover(function(){
$(".trade02 .show .info").eq($(this).index()).show().siblings().hide()
$(this).addClass("active").siblings().removeClass("active")
})
})
$(document).ready(function(){
$(".yandex01 .second-nav ul li").eq(0).addClass("active");
$(".yandex01 .show .info").eq(0).show();
$(".yandex01 .second-nav ul li").hover(function(){
$(".yandex01 .show .info").eq($(this).index()).show().siblings().hide()
$(this).addClass("active").siblings().removeClass("active")
})
})
$('.lookMore .moreBtn').on('click',function(){
$(this).css('display','none')
$(this).parent().find('.packBtn').css('display','inline-block')
// $(this).parent().css('display','none')
$(this).parent().parent().find('.txt').addClass('expandTxt')
})
$('.packBtn').on('click',function(){
$(this).css('display','none')
$(this).parents().find('.txt').removeClass('expandTxt')
$(this).parents().find('.lookMore .moreBtn').css('display','inline-block')
})
$(document).ready(function(){
$(".whatsapp03 .list ul li").eq(0).addClass("active");
$(".whatsapp03 .show .info").eq(0).show();
$(".whatsapp03 .list ul li").hover(function(){
$(".whatsapp03 .show .info").eq($(this).index()).show().siblings().hide()
$(this).addClass("active").siblings().removeClass("active")
})
})