锘
// 璁剧疆涓轰富椤
function SetHome(obj, vrl) {
try {
obj.style.behavior = 'url(#default#homepage)'; obj.setHomePage(vrl);
}
catch (e) {
if (window.netscape) {
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
}
catch (e) {
alert("姝ゆ搷浣滆娴忚鍣ㄦ嫆缁濓紒\n璇峰湪娴忚鍣ㄥ湴鍧€鏍忚緭鍏モ€渁bout:config鈥濆苟鍥炶溅\n鐒跺悗灏 [signed.applets.codebase_principal_support]鐨勫€艰缃负'true',鍙屽嚮鍗冲彲銆?);
}
var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
prefs.setCharPref('browser.startup.homepage', vrl);
} else {
alert("鎮ㄧ殑娴忚鍣ㄤ笉鏀寔锛岃鎸夌収涓嬮潰姝ラ鎿嶄綔锛?.鎵撳紑娴忚鍣ㄨ缃€?.鐐瑰嚮璁剧疆缃戦〉銆?.杈撳叆锛? + vrl + "鐐瑰嚮纭畾銆?);
}
}
}
// 鍔犲叆鏀惰棌 鍏煎360鍜孖E6
function shoucang(sTitle, sURL) {
try {
window.external.addFavorite(sURL, sTitle);
}
catch (e) {
try {
window.sidebar.addPanel(sTitle, sURL, "");
}
catch (e) {
alert("鍔犲叆鏀惰棌澶辫触锛岃浣跨敤Ctrl+D杩涜娣诲姞");
}
}
}
function uaredirect(url) {
if ((navigator.userAgent.match(/(iPhone|iPod|Android|ios|iPad|htc)/i))) {
document.location.href = url;
}
}
//楠岃瘉鐢佃瘽
function ValidatePhone(val) {
var isPhone = /^([0-9]{3,4}-)?[0-9]{7,8}$/;//鎵嬫満鍙风爜
var isMob = /^0?1[3|4|5|8][0-9]\d{8}$/;// 搴ф満鏍煎紡
if (isMob.test(val) || isPhone.test(val)) {
return true;
}
else {
return false;
}
}
function change() {
var imgNode = document.getElementById("vimg");
imgNode.src = "/backcmd/ajax/system/WaterMark.ashx?t=" + (new Date()).valueOf(); // 杩欓噷鍔犱釜鏃堕棿鐨勫弬鏁版槸涓轰簡闃叉娴忚鍣ㄧ紦瀛樼殑闂
}
//棣栭〉鎻愪氦鑱旂郴淇℃伅
function indexsubmit() {
$(".submit1").click(function () {
var name = $("#name").val()
var phone = $("#phone").val()
var yzcode = $("#yzcode").val()
//var address = $("#address").val()
//var msg = $("#msg").val()
if (name == null || name == "") {
alert("璇疯緭鍏ュ鍚?)
return false
}
if (phone == null || phone == "") {
alert("璇疯緭鍏ョ數璇?)
return false
} else {
if (ValidatePhone(phone) == false) {
alert('璇疯緭鍏ユ纭殑鐢佃瘽鍙风爜');
return false;
}
}
if (yzcode == null || yzcode == "") {
alert("璇疯緭鍏ラ獙璇佺爜")
return false
}
//if (msg == null || msg == "") {
// alert("璇疯緭鍏ョ暀瑷€")
// return false
//}
var field = {
name: name,
phone: phone,
yzcode: yzcode
}
$.ajax({
url: "content/ajax/onlinemessage.ashx",
async: false,//杩欎竴姝ユ槸闈炲父閲嶈鐨勶紝浣滅敤鏄缃负鍚屾鎵ц
type: "POST",
data: field,
dataType: "json",
success: function (data) {
if (data.state == 'ok') {
window.location.href = 'msgsuccess'
} else {
alert(data.message);
$("#name").val('')
$("#phone").val('')
$("#yzcode").val('')
alert('鐣欒█澶辫触')
change()
}
}
});
})
}
//鎼滅储鍔熻兘
function sousuo() {
console.log('sousuo')
$(".formsearch .searbtn").mouseover(function () {
$(".formsearch").css("background", "#e5e5e5").css("width", "250px")
$(".formsearch input").focus()
})
$(".formsearch input").blur(function () {
$(".formsearch").css("background", "#fff").css("width", "50px")
})
$(".formsearch .searbtn").click(function () {
var str = $(".formsearch input").val();
if (str.length > 0) {
window.location.href = "search?str=" + str;
} else {
alert("璇疯緭鍏ユ悳绱㈠唴瀹?");
}
})
}
//鍐呴〉鍒嗙被涓嬫媺鏁堟灉
function nytypeDownList() {
var cache_h = $(".ntype").height()
$(".nytype .ntit i").click(function () {
var nytype_h = $(".nytype").height()
var base_h = 30
if (nytype_h > base_h) {
$(".nytype").height(base_h)
$(this).html("")
} else {
$(".nytype").height(cache_h + base_h)
$(this).html("")
}
});
$('.pli a').click(function () {
$(".nytype").attr("style", "")
})
}
//浜у搧涓嬬骇鍒嗙被
function showChildType() {
$('.ntype .pli a').hover(function () {
var tid = this.dataset.tid
var that = this
$.ajax({
url: "../ajax/showChildType.ashx",
async: false,
type: "POST",
data: { tid: tid },
dataType: "json",
success: function (data) {
var tabdata = data.table
var len = tabdata.length
if (len > 0) {
var tnav_data = ''
for (var i = 0; i < len; i++) {
tnav_data += '' + tabdata[i].name + ''
}
var addhtml = '
' + tnav_data + '
'
$(that).append(addhtml)
}
}
});
}, function () {
$(this).find('.pli').remove()
})
//绂佺敤pli璺宠浆
$('.elink').attr("href", "javascript:void()")
}
//鍘绘帀html鏍囩
function repalceHtml(str) {
var dd = str.replace(/<\/?.+?>/g, "");
var dds = dd.replace(/ /g, "");//dds涓哄緱鍒板悗鐨勫唴瀹
return dds;
}
//浜у搧鐣欒█鎻愪氦
function message() {
$(".msgbox #submit").click(function () {
var company = $("#company").val()
var names = $("#names").val()
var phone = $("#phone").val()
var hangye = $("#hangye").val()
if (company == null || company == "") {
alert("璇疯緭鍏ュ叕鍙稿悕")
return false
}
if (names == null || names == "") {
alert("璇疯緭鍏ュ鍚?)
return false
}
if (phone == null || phone == "") {
alert("璇疯緭鍏ヨ仈绯荤數璇?)
return false
} else {
if (ValidatePhone(phone) == false) {
alert('杈撳叆鑱旂郴鐢佃瘽鏍煎紡涓嶆纭?);
return false;
}
}
//if (email == null || email == "") {
// alert("Please enter e-mail.")
// return false
//} else {
// var at = email.indexOf('@')
// var dot = email.indexOf('.')
// if (at >= dot) {
// alert("Please enter the correct e-mail.")
// return false
// }
//}
if (hangye == null || hangye == "") {
alert("璇疯緭鍏ヨ涓?)
return false
}
var d = {}
var t = $('form').serializeArray()
$.each(t, function () {
d[this.name] = this.value
})
var post_data = JSON.stringify(d)
console.log(post_data)
$.ajax({
url: 'Content/ajax/onlinemessage.ashx',
method: 'post',
data: JSON.parse(post_data),
dataType: 'json',
success: function (data) {
if (data.state == 'ok') {
//鐣欒█鎴愬姛
console.log(data.state)
alert(data.message)
$("#company").val('')
$("#names").val('')
$("#phone").val('')
$("#hangye").val('')
} else {
//鐣欒█澶辫触
alert(data.message)
$('form')[0].reset()
}
}
})
})
}
//鐑攢浜у搧婊氬姩
function scroll() {
//浜у搧婊氬姩
var speed = 30; //鏁板瓧瓒婂ぇ閫熷害瓒婃參
var tab = document.getElementById("demo");
var tab1 = document.getElementById("demo1");
var tab2 = document.getElementById("demo2");
var liwidth = tab1.getElementsByTagName("li");
var liwidths = liwidth[0].offsetWidth;
var length = $("#demo1 li").length;
var mleft = parseInt($("#demo1 li:eq(0)").css("marginLeft"));
var mright = parseInt($("#demo1 li:eq(0)").css("marginRight"));
var totalwidth = (liwidths + mleft + mright) * length * 2 + 300;
$("#indemo").width(totalwidth);
tab2.innerHTML = tab1.innerHTML;
var derection = 1;
$(".l_btn").click(function () {
derection = 1;
});
$(".r_btn").click(function () {
derection = 0;
});
function Marquee() {
if (derection) {
if (tab2.offsetWidth - tab.scrollLeft <= 0)
tab.scrollLeft -= tab1.offsetWidth;
else {
tab.scrollLeft++;
}
} else {
if (tab.scrollLeft <= 0)
tab.scrollLeft += tab1.offsetWidth;
else {
tab.scrollLeft--;
}
}
}
var MyMar = setInterval(Marquee, speed);
tab.onmouseover = function () {
clearInterval(MyMar);
};
tab.onmouseout = function () {
MyMar = setInterval(Marquee, speed);
};
}
//鐑攢浜у搧榧犳爣婊戣繃鏍峰紡
function hotproducthover() {
$('.product_list1 > li').hover(function () {
$(this).find('.mo').stop().show();
}, function () {
$(this).find('.mo').stop().hide();
});
}
function csubstr(str, len) {
if (str.length > len) {
return str.substring(0, len) + "...";
} else {
return str;
}
}
//瀵艰埅閾炬帴浼樺厛
function LinkChang() {
var s = $(".link");
var len = s.length;
for (var i = 0; i < len; i++) {
var link = s[i].dataset.link == undefined ? '' : s[i].dataset.link;
if (link == "#" || link == "###" || link.length <= 8) {
//鍒ゆ柇閾炬帴涓?鎴栬€呴暱搴﹀皬浜?浣嶆椂涓嶈繘琛岀疆鎹
} else {
//鍚﹀垯榛樿閾炬帴缃崲涓烘寚瀹氶摼鎺
s[i].href = link;
s[i].target = '_blank';
}
}
}
function isIE() {
var userAgent = navigator.userAgent,
rMsie = /(msie\s|trident.*rv:)([\w.]+)/,
rFirefox = /(firefox)\/([\w.]+)/,
rOpera = /(opera).+version\/([\w.]+)/,
rChrome = /(chrome)\/([\w.]+)/,
rSafari = /version\/([\w.]+).*(safari)/;
var browser;
var version;
var ua = userAgent.toLowerCase();
var match = rMsie.exec(ua);
if (match != null) {
ieVersion = { browser: "IE", version: match[2] || "0" };
alert('涓轰簡鎮ㄨ兘浣撻獙鍒版洿濂界殑娴忚鏁堟灉,寤鸿鎮ㄤ笅杞借胺姝屾祻瑙堝櫒')
window.location.href = 'content/plug/recommend/index.html'
return true;
}
var match = rFirefox.exec(ua);
if (match != null) {
var ffVersion = { browser: match[1] || "", version: match[2] || "0" };
return false;
}
var match = rOpera.exec(ua);
if (match != null) {
var opVersion = { browser: match[1] || "", version: match[2] || "0" };
return false;
}
var match = rChrome.exec(ua);
if (match != null) {
var chVersion = { browser: match[1] || "", version: match[2] || "0" };
return false;
}
var match = rSafari.exec(ua);
if (match != null) {
var sfVersion = { browser: match[2] || "", version: match[1] || "0" };
return false;
}
if (match != null) {
var ohterVersion = { browser: "", version: "0" };
return false;
}
}
//mob-banner-resize
function mobbanner() {
var win_w = $(window).width()
if (win_w <= 960) {
var ban_w = $('.header .indexbanner').width()
$('.header .indexbanner').height(ban_w * 810 / 1920)
} else {
$('.header .indexbanner').height(810)
}
}
function responsive() {
//瀵艰埅
$(".nav-btn").click(function () {
var state = $(this).data('state')
if (state == "off") {
$(this).data('state', 'on')
console.log(1)
$(this).find('.line').eq(0).css("top", "50%").css('margin-top', '-1px').css('transform', 'rotate(-45deg)')
$(this).find('.line').eq(1).css("opacity", "0")
$(this).find('.line').eq(2).css("top", "50%").css('margin-top', '-1px').css('transform', 'rotate(45deg)')
$(".header .nav").show()
} else {
$(this).data('state', 'off')
console.log(2)
$(this).find('.line').eq(0).css("top", "0%").css('margin-top', '5px').css('transform', 'rotate(0deg)')
$(this).find('.line').eq(1).css("opacity", "1")
$(this).find('.line').eq(2).css("top", "initial").css('margin-top', '-1px').css('transform', 'rotate(0deg)')
$(".header .nav").hide()
}
})
}
/*鍘婚櫎HTML鏍囩*/
function delHtmlTag(str) {
if (str == null || str == undefined) {
str = ""
} else {
str = str.replace(/<[^>]+>/g, "")
}
return str
}
function subNav() {
$(".nav .nav_item").hover(function () {
$(this).find(".subnav").stop(true, true).slideDown();
console.log('dasdsasda');
}, function () {
$(this).find(".subnav").stop(true).slideUp();
})
$(".nav .st_select_ul .st_select_item").mouseover(function () {
$(this).addClass('on');
$(this).siblings(".st_select_item").removeClass("on");
})
$(".st_select_ul").mouseover(function () {
if ($(this).hasClass("select_ul_limbs") == true) {
var index = $(this);
$(this).find(".st_select_item").mouseover(function () {
var data = $(this).attr("data-parent");
$(".select_ul_limbs").addClass("ative");
$('.select_ul_branches').find(".st_select_item").hide();
$('.select_ul_branches1').find(".st_select_item").hide();
$('.select_ul_branches2').find(".st_select_item").hide();
$(".select_ul_branches").find('.st_select_item[data-parent="' + data + '"]').show();
})
} else if ($(this).hasClass("select_ul_branches") == true) {
$(this).find(".st_select_item").mouseover(function () {
var data = $(this).attr("data-role");
$(".select_ul_branches").addClass("ative");
$(".select_ul_branches1").find(".st_select_item").hide();
$('.select_ul_branches2').find(".st_select_item").hide();
$(".select_ul_branches1").find('.st_select_item[data-role="' + data + '"]').show();
})
} else if ($(this).hasClass("select_ul_branches1") == true) {
$(this).find(".st_select_item").mouseover(function () {
var data = $(this).attr("data-subcat");
$(".select_ul_branches1").addClass("ative");
$(".select_ul_branches2").find(".st_select_item").hide();
$(".select_ul_branches2").find('.st_select_item[data-subcat="' + data + '"]').show();
})
}
})
}
$(document).ready(function () {
isIE()
wow = new WOW(
{
boxClass: 'wow', // 榛樿灞炴€у悕
animateClass: 'animated', // 榛樿瑙﹀彂鐨勫姩鐢荤被(鍖呭惈鍦╝nimate css涓?
offset: 0, // 涓烘墍鏈夋坊鍔爓ow鐨勫厓绱犺缃 data-wow-delay灞炴€ 鐨勯粯璁ゅ€
mobile: false, // 鏄惁鍦ㄧЩ鍔ㄨ澶囦腑寮€鍚姩鐢
live: true // 鎸佺画鐩戞祴椤甸潰涓槸鍚︽彃鍏ユ柊鐨剋ow鍏冪礌
}
);
wow.init()
sousuo()
subNav()
uaredirect('/mobile')
})