锘?(function() {
wowInt();
findTel();
phoneTargetSelf();
share();
$(".back_top").click(function(){
$("html,body").stop().animate({scrollTop:0});
})
$(window).scroll(function(){
if($(window).scrollTop()>100){
$(".back_top").show().stop().animate({"opacity":1});
}else{
$(".back_top").stop().animate({"opacity":0},function(){
$(".back_top").hide();
});
}
})
$(document).on("click",".links span",function(e){
e.preventDefault()
e.stopPropagation()
$(this).siblings().stop().slideToggle();
})
$(document).click(function(){
$(".links-show").stop().slideUp();
})
if ($(document).width() <= 1024) {
$(".header").addClass("header-mb");
$(".header-mb .toggle-menu").click(function(){
$(".header-mb .toggle-menu").toggleClass("open")
$(".header-mb .header-cr").toggleClass("header-cr-show");
})
$(".header-mb nav ul li.twosub .after-icon").click(function(){
var idx=$(this).index();
$(this).toggleClass("cut").siblings(".header-mb ul li.twosub .after-icon").removeClass("cut");
$(this).next(".header-mb nav ul li.twosub .category").toggle().siblings(".header-mb nav ul li.twosub").find(".header-mb nav ul li.twosub .category").hide();
})
}
$(window).resize(function(){
if( $(window).width() < 1025 ) {
$(".header").addClass("header-mb")
}else{
$(".header").removeClass("header-mb")
}
});
//灞忚斀鍙抽敭鑿滃崟
document.oncontextmenu = function (event){
銆€銆€if(window.event){
銆€銆€銆€銆€event = window.event;
銆€銆€銆€銆€}try{
銆€銆€銆€銆€銆€銆€var the = event.srcElement;
銆€銆€銆€銆€銆€銆€if (!((the.tagName == "INPUT" && the.type.toLowerCase() == "text") || the.tagName == "TEXTAREA")){
銆€銆€銆€銆€銆€銆€銆€銆€return false;
銆€銆€銆€銆€銆€銆€}
銆€銆€銆€銆€return true;
銆€銆€}catch (e){
銆€銆€銆€銆€return false;
銆€銆€}
}
});
//--------------鐐瑰嚮鍒嗕韩
function share(){
/*
$(".share_in").click(function () {//linkedin
var url = $(this).data("txt");
var url = window.location.href;
var title = document.title;
var op = "//www.linkedin.com/uas/login?title=" + title + "&url=" + encodeURIComponent(url) + "";
window.open(op);
})
$(".share_bdtb").click(function () {//鐧惧害璐村惂
var url = $(this).data("txt");
var url = window.location.href;
var title = document.title;
var op = "http://tieba.baidu.com/f/commit/share/openShareApi?title=" + title + "&url=" + encodeURIComponent(url) + "";
window.open(op);
})
$(".share_qqkj").click(function () {//鑵捐寰崥
var url = $(this).data("txt");
var url = window.location.href;
var title = document.title;
var op = "https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?title=" + title + "&url=" + encodeURIComponent(url) + "";
window.open(op)
})
$(".share_douban").click(function () {//璞嗙摚
var url = $(this).data("txt");
var url = window.location.href;
var title = document.title;
var op = "https://www.douban.com/share/service?title=" + title + "&url=" + encodeURIComponent(url) + "";
window.open(op);
})*/
$(".share_qqkj").click(function () {//鑵捐寰崥
var url = $(this).data("txt");
var url = window.location.href;
var title = document.title;
var op = "https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?title=" + title + "&url=" + encodeURIComponent(url) + "";
window.open(op)
})
$(".share_wb").click(function () {//寰崥
var url = $(this).data("txt");
var url = window.location.href;
var title = document.title;
var op = "https://service.weibo.com/share/share.php?title=" + title + "&url=" + encodeURIComponent(url) + "";
window.open(op)
})
$(".share_qq").click(function () {//QQ
var url = $(this).data("txt");
var url = window.location.href;
var title = document.title;
var op = "https://connect.qq.com/widget/shareqq/index.html?url=" + encodeURIComponent(url) + "";
window.open(op);
})
//寰俊
$(".share_wx,.share_wx_d").attr("data-qrcode","https://www.xinhongru.com/qrcode/qrcode.php?content="+window.location.href);
//$(".share_wx").attr("data-qrcode", "/qrCode/Index.aspx?url=" + window.location.href);
$(".share_wx,.share_wx_d").click(function () {//寰俊
//var url = "/qrCode/Index.aspx?url=" + window.location.href;
var url = $(this).attr("data-qrcode")
console.log(url)
var title = ""
title += "
"
title += "
x"
title += "
浜岀淮鐮?/h2>"
title += ""
title += "
鎵竴鎵?/p>"
title += "
"
$("body").remove(".weixin");
$("body").append(title)
})
$(document).on("click", ".weixin .c", function () {
$(".weixin").remove();
})
// $(".share_wx_d").attr("data-qrcode","http://www.xinhongru.com/qrcode/qrcode.php?content="+window.location.href); //娴嬭瘯
// //$(".share_wx_d").attr("data-qrcode","/qrCode/Index.aspx?url="+window.location.href); //姝e紡鐢ㄨ繖涓紝宸茬粡鏇存柊鍒板悗鍙
// $(".share_wx_d").click(function () {//寰俊
// var url = $(this).attr("data-qrcode")
// //alert(url)
// var title = ""
// title += ""
// title += "
x"
// title += "
浜岀淮鐮?/h2>"
// title += ""
// title += "
鎵竴鎵?/p>"
// title += "
"
// $("body").remove(".weixin");
// $("body").append(title)
// })
}
//wow鍏ュ満
function wowInt(){
if (!(/msie [6|7|8|9]/i.test(navigator.userAgent))){
var wow = new WOW({
boxClass: 'wow',
animateClass: 'animated',
offset: -100,
mobile: true,
live: true
});
wow.init();
};
}
/*鎵嬫満绔摼鎺ユ敼涓烘湰绐楀彛鎵撳紑*/
function phoneTargetSelf(context){
if ($(window).width()<1024) {
if(context==undefined){
context=$(document);
}
$('a',context).each(function(){
var target=$(this);
var link=target.attr('target');
target.attr('target','_self');
})
$(".toContact").on("click",function(){
window.location.href = window.location.origin + "/connect/"
})
}
}
/*鐢佃瘽閾炬帴鍙栨秷榛樿浜嬩欢骞舵坊鍔犳牱寮?/
function findTel(context){
if ($(window).width()>1024) {
var condition = /^tel\:([0-9\-]+)|tel\:\+([0-9\-]+)$/;
if(context==undefined){
context=$(document);
}
$('a',context).each(function(index, el) {
var target=$(this);
var href=target.attr('href');
if (condition.test(href)) {
target.addClass('tel_link');
target.on('click',function(event){
event.preventDefault();
})
}
});
}
}
/*ie9鐨刾laceholder鍖呭惈瀵嗙爜妗嗙殑鍏煎*/
$(function(){
if(!placeholderSupport()){ // 鍒ゆ柇娴忚鍣ㄦ槸鍚︽敮鎸 placeholder
$('input').not("input[type='password']").each(
function() {
var self = $(this);
var val = self.attr("placeholder");
input(self, val);
/*if($(this).val()=="" && $(this).attr("placeholder")!=""){
$(this).val($(this).attr("placeholder"));
$(this).focus(function(){
if($(this).val()==$(this).attr("placeholder")) $(this).val("");
});
$(this).blur(function(){
if($(this).val()=="") $(this).val($(this).attr("placeholder"));
});
}*/
}
);
$('input[type="password"]').each(
function() {
var pwdField = $(this);
var pwdVal = pwdField.attr('placeholder');
var pwdClass = pwdField.attr('class');
// 閲嶅懡鍚嶈input鐨刬d涓哄師id鍚庤窡1
pwdField.after('');
var pwdPlaceholder = $(this).siblings('.login-input');
pwdPlaceholder.show();
pwdField.hide();
pwdPlaceholder.focus(function(){
pwdPlaceholder.hide();
pwdField.show();
pwdField.focus();
});
pwdField.blur(function(){
if(pwdField.val() == '') {
pwdPlaceholder.show();
pwdField.hide();
}
});
}
);
};
})
// 鍒ゆ柇娴忚鍣ㄦ槸鍚︽敮鎸乸laceholder灞炴€
function placeholderSupport() {
return 'placeholder' in document.createElement('input');
}
// jQuery鏇挎崲placeholder鐨勫鐞
function input(obj, val) {
var $input = obj;
var val = val;
$input.attr({value:val});
$input.focus(function() {
if ($input.val() == val) {
$(this).attr({value:""});
}
}).blur(function() {
if ($input.val() == "") {
$(this).attr({value:val});
}
});
}
//end
/*ie9鐨則exdarea鐨刾laceholder鍏煎*/
$(function(){
if($("html").hasClass("lt10")){
var $textarea = $('textarea');//鑾峰彇鍏冪礌闆嗗悎
銆€銆€$.each($textarea,function(i,el){//閬嶅巻
銆€銆€銆€銆€if($(el).text() == ''){
銆€銆€銆€銆€銆€銆€$(el).siblings('.ieTextarea').removeClass('ieTextHide');
銆€銆€銆€銆€}else{
銆€銆€銆€銆€銆€銆€$(el).siblings('.ieTextarea').addClass('ieTextHide');
銆€銆€銆€銆€};
銆€銆€});
銆€銆€$('.ieTextarea').off('focus').focus(function(){//span鑱氱劍鐨勬椂鍊
銆€銆€銆€銆€$(this).addClass('ieTextHide');
銆€銆€銆€銆€$(this).siblings('textarea').focus();//妯′豢textarea鑱氱劍
銆€銆€});
銆€銆€$('textarea').off('blur').blur(function(){
銆€銆€銆€銆€if($(this).text() == ""){
銆€銆€銆€銆€銆€銆€$(this).siblings('.ieTextarea').removeClass('ieTextHide');//澶辩劍鐨勬椂鍊欒妯℃嫙span鏄剧ず
銆€銆€銆€銆€}
銆€銆€});
銆€銆€$('textarea').off('focus').focus(function(){
銆€銆€銆€銆€$(this).siblings('.ieTextarea').addClass('ieTextHide');
銆€銆€});
}
})
// 鍒嗕韩鍒伴鑻
$(document).on('click', '.share_link', function () {
var _href = 'https://www.linkedin.com/shareArticle?mini=true'
_href += '&title=' + document.title //鏍囬
_href += '&url=' + encodeURIComponent(window.location.href) //閾炬帴
window.open(_href)
})
// 鍒嗕韩鍒伴鑻卞鐞
function Escape(url) {
url = url.replace(/\=/g, '%3D') //"""杞箟
url = url.replace(/\&/g, '%26') //"&"杞箟
return url
}