web前端游戏项目-辨色大比拼【附源码】
《辨色大比拼》是一个旨在测试和提升玩家颜色识别能力的在线游戏。在游戏中,玩家将通过辨识颜色来解谜并推进游戏进程。辨色大比拼也是一个寓教于乐的游戏,它不仅提供了一个有趣的辨色挑战,还能帮助玩家提高颜色识别能力,增强对色彩的敏感度。通过与其他玩家竞争和比较分数,玩家可以提升自己的辨色技能,享受游戏的乐趣
运行效果:
HTML
源码:
<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width; initial-scale=1; maximum-scale=1; minimum-scale=1; user-scalable=no;">
<meta name="keywords" content="辨色大比拼">
<meta name="description" content="辨色大比拼通过有趣的心理游戏训练你的眼睛和大脑的反应协调能力">
<meta property="og:image" content="logo.jpg">
<title>最坑人的辨色大比拼!</title>
<style type="text/css">
.green{color:#27ae60;}.red{color:#e74c3c;}.orange{color:#f39c12;}.yellow{color:#f6dd09;}.blue{color:#3498db;}.black{color:#000;}.brown{color:#795118;}.all_quest h1{font-size:40px;margin-top:30px;}
body{background:url(460.jpg) repeat left top;color:#61696a;font-family:'Bree Serif',serif;font-size:13px;margin:0;padding:0;-webkit-text-size-adjust:none}h1{color:#2e4053;font-size:28px;margin-top:10px}h2{border-top:1px dotted #61696a;margin-top:30px;padding-top:30px}a{color:#3498db;text-decoration:none;transition:all ease 1s;}a:hover{background:#f39c12;border-color:#f39c12;}p{margin:0}p.sequence{color:#2e4053;font-size:20px;margin:0 0 10px}span.blank{border:2px dotted #ffc000;color:#ffc000;padding:1px 10px;-webkit-border-radius:100px;-moz-border-radius:100px;border-radius:100px}.wrapper{background:url(h.png) no-repeat center -15px;text-align:center;position:relative;height:480px;width:100%}.splash,.howto,ul.hud{position:absolute;left:50%}.splash{background:url(b.png) no-repeat center -200px;padding-top:189px;top:10px;margin-left:-90px;}.howto{margin-left:-120px;top:10px}.all_quest{position:relative;top:80px}.button{background:#e74c3c;border:2px solid #e74c3c;color:#fff;display:inline-block;font-size:16px;margin-top:5px;padding:5px 10px;-webkit-border-radius:100px;-moz-border-radius:100px;border-radius:100px}ul{list-style-type:none;margin:0;padding:0}ul li{display:inline-block;margin:0;padding:0}ul.hud{top:30px;margin-left:-150px}ul.hud li{color:#61696a;margin:0 10px;text-align:left;width:105px}ul.hud li.timeCount{background:url(b.png) no-repeat left -62px;padding-left:25px}ul.hud li.totalQuest{background:url(b.png) no-repeat -148px -62px;padding-left:25px}.answer{margin-top:50px}.answer ul li{font-size:24px;margin:0 10px 10px}.answer ul li a{border:2px solid #ffc000;color:#ffc000;display:inline-block;padding:1px 10px;-webkit-border-radius:100px;-moz-border-radius:100px;border-radius:100px}.answer ul li a.option_a:hover,.answer ul li a.option_b:hover,.answer ul li a.option_c:hover,.answer ul li a.option_d:hover{background-color:#0f591b}.answer ul li a.option_a{/*background:url(b.png) no-repeat 9px -5px*/}.answer ul li a.option_b{/*background:url(b.png) no-repeat -48px -5px*/}.answer ul li a.option_c{/*background:url(b.png) no-repeat -114px -5px*/}.answer ul li a.option_d{/*background:url(b.png) no-repeat -176px -5px*/}a.disable_click{pointer-events:none}.hint{height:20px;position:relative;top:85px}.tick{background:url(b.png) no-repeat left -110px;text-indent:-99999px;height:50px;width:55px}.cross{background:url(b.png) no-repeat -75px -110px;text-indent:-99999px;height:50px;width:55px}.result{margin:0 auto;position:relative;top:-45px}.result span.score{color:#27ae60;display:block;font-size:24px}.copyrights{position:absolute;margin-left:-173px;left:50%;top:375px;width:346px}.copyrights p{color:#7f888f;}.copyrights a{background: none;}.copyrights a:hover{background: none;}.fb_plugin{margin:0 auto;padding:0 20px;width:320px}.other_game{background:#222;margin:0 auto;overflow:hidden;padding:10px;width:708px}.other_game p{color:#ccc;font-family:Arial,Helvetica,sans-serif;font-weight:normal;font-size:14px;margin-top:0}.other_game ul{list-style-type:none;margin:0;padding:0}.other_game ul li{margin-top:10px;display:block;}.other_game ul li:first-child{margin:0}.other_game ul li img{float:left;margin-right:10px}.other_game a{display:block;color:#09c;font-size:14px;overflow:hidden;text-decoration:none}.other_game a:hover{background:#138c46;color: #fff;}.other_game a span{font-size:12px;font-family:Arial,Helvetica,sans-serif;color:#ccc}@media screen and (max-width:320px){.wrapper{overflow-x:hidden;width:320px;min-width:320px}.splash{margin-left:-160px;width:320px}.splash h1{font-size:18px}h2{margin-top:15px;padding-top:15px}.howto{margin-left:-150px;width:300px}.copyrights p{font-size:11px}.fb_plugin{width:280px;padding:0}.result{width:280px}.result span.score{font-size:16px}}
</style>
<link href="bdsstyle.css" rel="stylesheet" type="text/css"><script src="logger.js"></script></head>
<body style="zoom: 1;">
<div class="wrapper">
<div class="splash">
<h1><span class="green">红</span> 还是 <span class="red">绿</span>?</h1>
<p><a href="honghaishilv.html" class="button">继续</a></p>
</div><!-- END splash -->
<div class="howto" style="display: none;">
<h1>怎么玩?</h1>
<p>你的颜色敏感度测试? 你的右脑怎么样?<br>做完这个测试,你就知道了!</p>
<p>下面让我们来测试下!</p>
<h2>规则</h2>
<p><strong>选择你看到的字的颜色!</strong></p>
<p><a href="honghaishilv.html" class="button">开始游戏!</a></p>
</div><!-- END howto -->
<ul class="hud">
<li class="timeCount"></li><!-- END timeCount -->
<li class="totalQuest" style="display: none;">问题 1 / 20</li><!-- END totalQuest -->
</ul>
<div class="all_quest">
<div class="quest1" style="display: none;">
<p class="sequence">字的颜色是什么?</p>
<h1 class="green">橙</h1>
<div class="answer">
<ul>
<li><a href="honghaishilv.html" class="option_a" data-verify="cuo">红</a></li>
<li><a href="honghaishilv.html" class="option_b" data-verify="dui">绿</a></li>
<li><a href="honghaishilv.html" class="option_c" data-verify="cuo">橙</a></li>
<li><a href="honghaishilv.html" class="option_d" data-verify="cuo">蓝</a></li>
</ul>
</div><!-- END answer -->
</div><!-- END quest1 -->
<div class="quest2" style="display: none;">
<p class="sequence">字的颜色是什么?</p>
<h1 class="red">黑</h1>
<div class="answer">
<ul>
<li><a href="honghaishilv.html" class="option_a" data-verify="cuo">绿</a></li>
<li><a href="honghaishilv.html" class="option_b" data-verify="cuo">黑</a></li>
<li><a href="honghaishilv.html" class="option_c" data-verify="dui">红</a></li>
<li><a href="honghaishilv.html" class="option_d" data-verify="cuo">黄</a></li>
</ul>
</div><!-- END answer -->
</div><!-- END quest2 -->
<div class="quest3" style="display: none;">
<p class="sequence">字的颜色是什么?</p>
<h1 class="yellow">黄</h1>
<div class="answer">
<ul>
<li><a href="honghaishilv.html" class="option_a" data-verify="cuo">绿</a></li>
<li><a href="honghaishilv.html" class="option_b" data-verify="cuo">黑</a></li>
<li><a href="honghaishilv.html" class="option_c" data-verify="cuo">蓝</a></li>
<li><a href="honghaishilv.html" class="option_d" data-verify="dui">黄</a></li>
</ul>
</div><!-- END answer -->
</div><!-- END quest3 -->
<div class="quest4" style="display: none;">
<p class="sequence">字的颜色是什么?</p>
<h1 class="blue">红</h1>
<div class="answer">
<ul>
<li><a href="honghaishilv.html" class="option_a" data-verify="cuo">黄</a></li>
<li><a href="honghaishilv.html" class="option_b" data-verify="cuo">橙</a></li>
<li><a href="honghaishilv.html" class="option_c" data-verify="cuo">红</a></li>
<li><a href="honghaishilv.html" class="option_d" data-verify="dui">蓝</a></li>
</ul>
</div><!-- END answer -->
</div><!-- END quest4 -->
<div class="quest5" style="display: none;">
<p class="sequence">字的颜色是什么?</p>
<h1 class="black">黑</h1>
<div class="answer">
<ul>
<li><a href="honghaishilv.html" class="option_a" data-verify="cuo">绿</a></li>
<li><a href="honghaishilv.html" class="option_b" data-verify="cuo">蓝</a></li>
<li><a href="honghaishilv.html" class="option_c" data-verify="cuo">橙</a></li>
<li><a href="honghaishilv.html" class="option_d" data-verify="dui">黑</a></li>
</ul>
</div><!-- END answer -->
</div><!-- END quest5 -->
<div class="quest6" style="display: none;">
<p class="sequence">字的颜色是什么?</p>
<h1 class="yellow">绿</h1>
<div class="answer">
<ul>
<li><a href="honghaishilv.html" class="option_a" data-verify="dui">黄</a></li>
<li><a href="honghaishilv.html" class="option_b" data-verify="cuo">绿</a></li>
<li><a href="honghaishilv.html" class="option_c" data-verify="cuo">蓝</a></li>
<li><a href="honghaishilv.html" class="option_d" data-verify="cuo">红</a></li>
</ul>
</div><!-- END answer -->
</div><!-- END quest6 -->
<div class="quest7" style="display: none;">
<p class="sequence">字的颜色是什么?</p>
<h1 class="orange">黄</h1>
<div class="answer">
<ul>
<li><a href="honghaishilv.html" class="option_a" data-verify="cuo">黄</a></li>
<li><a href="honghaishilv.html" class="option_b" data-verify="cuo">黑</a></li>
<li><a href="honghaishilv.html" class="option_c" data-verify="dui">橙</a></li>
<li><a href="honghaishilv.html" class="option_d" data-verify="cuo">绿</a></li>
</ul>
</div><!-- END answer -->
</div><!-- END quest7 -->
<div class="quest8" style="display: none;">
<p class="sequence">字的颜色是什么?</p>
<h1 class="blue">蓝</h1>
<div class="answer">
<ul>
<li><a href="honghaishilv.html" class="option_a" data-verify="cuo">黑</a></li>
<li><a href="honghaishilv.html" class="option_b" data-verify="dui">蓝</a></li>
<li><a href="honghaishilv.html" class="option_c" data-verify="cuo">黄</a></li>
<li><a href="honghaishilv.html" class="option_d" data-verify="cuo">红</a></li>
</ul>
</div><!-- END answer -->
</div><!-- END quest8 -->
<div class="quest9" style="display: none;">
<p class="sequence">字的颜色是什么?</p>
<h1 class="yellow">绿</h1>
<div class="answer">
<ul>
<li><a href="honghaishilv.html" class="option_a" data-verify="cuo">绿</a></li>
<li><a href="honghaishilv.html" class="option_b" data-verify="dui">黄</a></li>
<li><a href="honghaishilv.html" class="option_c" data-verify="cuo">蓝</a></li>
<li><a href="honghaishilv.html" class="option_d" data-verify="cuo">黑</a></li>
</ul>
</div><!-- END answer -->
</div><!-- END quest9 -->
<div class="quest10" style="display: none;">
<p class="sequence">字的颜色是什么?</p>
<h1 class="orange">红</h1>
<div class="answer">
<ul>
<li><a href="honghaishilv.html" class="option_a" data-verify="cuo">蓝</a></li>
<li><a href="honghaishilv.html" class="option_b" data-verify="cuo">红</a></li>
<li><a href="honghaishilv.html" class="option_c" data-verify="dui">橙</a></li>
<li><a href="honghaishilv.html" class="option_d" data-verify="cuo">绿</a></li>
</ul>
</div><!-- END answer -->
</div><!-- END quest10 -->
<div class="quest11" style="display: none;">
<p class="sequence">字的颜色是什么?</p>
<h1 class="red">橙</h1>
<div class="answer">
<ul>
<li><a href="honghaishilv.html" class="option_a" data-verify="cuo">黑</a></li>
<li><a href="honghaishilv.html" class="option_b" data-verify="cuo">绿</a></li>
<li><a href="honghaishilv.html" class="option_c" data-verify="cuo">蓝</a></li>
<li><a href="honghaishilv.html" class="option_d" data-verify="dui">红</a></li>
</ul>
</div><!-- END answer -->
</div><!-- END quest11 -->
<div class="quest12" style="display: none;">
<p class="sequence">字的颜色是什么?</p>
<h1 class="orange">黑</h1>
<div class="answer">
<ul>
<li><a href="honghaishilv.html" class="option_a" data-verify="dui">橙</a></li>
<li><a href="honghaishilv.html" class="option_b" data-verify="cuo">绿</a></li>
<li><a href="honghaishilv.html" class="option_c" data-verify="cuo">黑</a></li>
<li><a href="honghaishilv.html" class="option_d" data-verify="cuo">蓝</a></li>
</ul>
</div><!-- END answer -->
</div><!-- END quest12 -->
<div class="quest13" style="display: none;">
<p class="sequence">字的颜色是什么?</p>
<h1 class="yellow">黄</h1>
<div class="answer">
<ul>
<li><a href="honghaishilv.html" class="option_a" data-verify="cuo">橙</a></li>
<li><a href="honghaishilv.html" class="option_b" data-verify="cuo">蓝</a></li>
<li><a href="honghaishilv.html" class="option_c" data-verify="cuo">绿</a></li>
<li><a href="honghaishilv.html" class="option_d" data-verify="dui">黄</a></li>
</ul>
</div><!-- END answer -->
</div><!-- END quest13 -->
<div class="quest14" style="display: none;">
<p class="sequence">字的颜色是什么?</p>
<h1 class="black">蓝</h1>
<div class="answer">
<ul>
<li><a href="honghaishilv.html" class="option_a" data-verify="cuo">绿</a></li>
<li><a href="honghaishilv.html" class="option_b" data-verify="dui">黑</a></li>
<li><a href="honghaishilv.html" class="option_c" data-verify="cuo">蓝</a></li>
<li><a href="honghaishilv.html" class="option_d" data-verify="cuo">红</a></li>
</ul>
</div><!-- END answer -->
</div><!-- END quest14 -->
<div class="quest15" style="display: none;">
<p class="sequence">字的颜色是什么?</p>
<h1 class="brown">绿</h1>
<div class="answer">
<ul>
<li><a href="honghaishilv.html" class="option_a" data-verify="cuo">绿</a></li>
<li><a href="honghaishilv.html" class="option_b" data-verify="cuo">橙</a></li>
<li><a href="honghaishilv.html" class="option_c" data-verify="cuo">黄</a></li>
<li><a href="honghaishilv.html" class="option_d" data-verify="dui">褐</a></li>
</ul>
</div><!-- END answer -->
</div><!-- END quest15 -->
<div class="quest16" style="display: none;">
<p class="sequence">字的颜色是什么?</p>
<h1 class="brown">褐</h1>
<div class="answer">
<ul>
<li><a href="honghaishilv.html" class="option_a" data-verify="cuo">蓝</a></li>
<li><a href="honghaishilv.html" class="option_b" data-verify="cuo">绿</a></li>
<li><a href="honghaishilv.html" class="option_c" data-verify="dui">褐</a></li>
<li><a href="honghaishilv.html" class="option_d" data-verify="cuo">黄</a></li>
</ul>
</div><!-- END answer -->
</div><!-- END quest16 -->
<div class="quest17" style="display: none;">
<p class="sequence">字的颜色是什么?</p>
<h1 class="green">红</h1>
<div class="answer">
<ul>
<li><a href="honghaishilv.html" class="option_a" data-verify="dui">绿</a></li>
<li><a href="honghaishilv.html" class="option_b" data-verify="cuo">红</a></li>
<li><a href="honghaishilv.html" class="option_c" data-verify="cuo">黑</a></li>
<li><a href="honghaishilv.html" class="option_d" data-verify="cuo">橙</a></li>
</ul>
</div><!-- END answer -->
</div><!-- END quest17 -->
<div class="quest18" style="display: none;">
<p class="sequence">字的颜色是什么?</p>
<h1 class="brown">橙</h1>
<div class="answer">
<ul>
<li><a href="honghaishilv.html" class="option_a" data-verify="dui">褐</a></li>
<li><a href="honghaishilv.html" class="option_b" data-verify="cuo">橙</a></li>
<li><a href="honghaishilv.html" class="option_c" data-verify="cuo">黄</a></li>
<li><a href="honghaishilv.html" class="option_d" data-verify="cuo">红</a></li>
</ul>
</div><!-- END answer -->
</div><!-- END quest18 -->
<div class="quest19" style="display: none;">
<p class="sequence">字的颜色是什么?</p>
<h1 class="blue">绿</h1>
<div class="answer">
<ul>
<li><a href="honghaishilv.html" class="option_a" data-verify="cuo">黑</a></li>
<li><a href="honghaishilv.html" class="option_b" data-verify="cuo">绿</a></li>
<li><a href="honghaishilv.html" class="option_c" data-verify="cuo">红</a></li>
<li><a href="honghaishilv.html" class="option_d" data-verify="dui">蓝</a></li>
</ul>
</div><!-- END answer -->
</div><!-- END quest19 -->
<div class="quest20" style="display: none;">
<p class="sequence">字的颜色是什么?</p>
<h1 class="black">褐</h1>
<div class="answer">
<ul>
<li><a href="honghaishilv.html" class="option_a" data-verify="cuo">绿</a></li>
<li><a href="honghaishilv.html" class="option_b" data-verify="cuo">红</a></li>
<li><a href="honghaishilv.html" class="option_c" data-verify="dui">黑</a></li>
<li><a href="honghaishilv.html" class="option_d" data-verify="cuo">蓝</a></li>
</ul>
</div><!-- END answer -->
</div><!-- END quest20 -->
<div class="result" style="display: none;">
<h1>你的分数</h1>
<p>你的答案<span class="score">0</span></p>
<div class="fb_plugin">
<!---->
<div class="baidu_share">
<!-- Baidu Button BEGIN -->
<script type="text/javascript" id="bdshare_js" data="type=tools&uid=603462" src="bds_s_v2.js"></script>
<script type="text/javascript">
document.getElementById("bdshell_js").src = "http://bdimg.share.baidu.com/static/js/shell_v2.js?cdnversion=" + Math.ceil(new Date()/3600000)
</script>
<!-- Baidu Button END -->
</div>
</div>
</div>
<div class="hint"><ul><li class="tick" style="display: none;">对!</li><li class="cross" style="display: none;">错!</li></ul></div><!-- END hint -->
<!-- END copyrights -->
</div>
<div id="share" style="display:none">
<img style="position:absolute;top:0;left:0;display:" onclick="document.getElementById('share').style.display='none';">
</div>
<script src="jquery.js"></script>
<script>
window.addEventListener("load",function(){setTimeout(function(){window.scrollTo(0,1)},0)});$(document).ready(function(){var i,totalQuest,timeUp,score,howto=$('.howto'),allQuest=$('.all_quest'),splash=$('.splash'),timeCountDiv=$(".timeCount"),totalQuestDiv=$('.totalQuest'),tickIcon=$('.tick'),crossIcon=$('.cross');init();function init(){i=1;totalQuest=20;timeUp=3500;score=0;$('.result').hide();howto.hide();$('.hint ul').children().hide();allQuest.children().hide();totalQuestDiv.hide().html('问题 '+i+' / '+totalQuest);splash.show()}$('.splash a').click(function(e){e.preventDefault();splash.hide();howto.fadeIn('slow')});$('.howto a').click(function(e){e.preventDefault();howto.hide();startGame()});$('.answer a').click(function(e){var ans=$(this).data('verify');var default_ans="dui";e.preventDefault();$('.answer a').addClass('disable_click');if(ans===default_ans){score+=1;tickIcon.fadeIn('slow',function(){$(this).fadeOut('fast')})}else{crossIcon.fadeIn('slow',function(){$(this).fadeOut('fast')})}$('.quest'+i).fadeOut('slow',function(){if(i<totalQuest&&timeUp>=1){i++;$('.quest'+i).fadeIn('slow',function(){$('.answer a').removeClass('disable_click')})}else{showResult();clearInterval(timeLoop)}totalQuestDiv.html('问题 '+i+' / '+totalQuest)})});$('.retry').click(function(e){e.preventDefault();init()});function startGame(){$('.quest1').show();timeCountDiv.show();totalQuestDiv.show();timeLoop=setInterval(timeUpCount,1000/60)}function timeUpCount(){var time=parseInt(timeUp);var minutes=Math.floor(time/60);var seconds=time%60;if(timeUp>=1){timeUp--}else{showResult();clearInterval(timeLoop)}timeCountDiv.html("时间 "+minutes+":"+seconds)}function showResult(){allQuest.children().hide();totalQuestDiv.hide();timeCountDiv.hide();$('.result .score').html('答对'+score+'个题,共'+totalQuest+'题.色感'+score*5+'分;');$('.result').fadeIn('slow');dp_submitScore(score)}});
</script>
<script language="javascript">
var mebtnopenurl = 'http://game.id87.com/youxi/';
window.shareData = {
"imgUrl": "logo.jpg",
"timeLineLink": "http://game.id87.com/youxi/games/honghaishilv/",
"tTitle": "最坑人的辨色大比拼!",
"tContent": "全世界最坑的辨色大比拼,1分钟内让你抓狂不已!"
};
function dp_submitScore(t){
dp_share(t);
}
function dp_share(t){
if(15>t && t> 5) {
document.title = "我的辨色力是"+t*5+"分!还不错吧!求超越!!!";
$('.result .score').append("还不错哦,眼脑协调能力正常!");
}else if(20>t && t>15){
document.title = "我的辨色力是"+t*5+"分!很不错噢!求超越!!!";
$('.result .score').append("好厉害,你的眼脑协调反应能力超强耶!");
}else if(t==20){
document.title = "我的辨色力是"+t*5+"分!满分了!求追平!!!";
$('.result .score').append("你的色感是满分!完美的色感和眼脑协调能力!");
}else{
document.title = "想知道你的色感和眼脑协调能力吗,来测下就知道!";
$('.result .score').append("你的色感好差哦!多练习几次吧!");
}
document.getElementById("share").style.display="";
window.shareData.tTitle = document.title;
}
function dp_Ranking(){
document.location.href = "http://g.huceo.com/weixin/";
}
document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
WeixinJSBridge.on('menu:share:appmessage', function(argv) {
WeixinJSBridge.invoke('sendAppMessage', {
"img_url": window.shareData.imgUrl,
"link": window.shareData.timeLineLink,
"desc": window.shareData.tContent,
"title": window.shareData.tTitle
}, function(res) {
document.location.href = mebtnopenurl;
})
});
WeixinJSBridge.on('menu:share:timeline', function(argv) {
WeixinJSBridge.invoke('shareTimeline', {
"img_url": window.shareData.imgUrl,
"img_width": "640",
"img_height": "640",
"link": window.shareData.timeLineLink,
"desc": window.shareData.tContent,
"title": window.shareData.tTitle
}, function(res) {
document.location.href = mebtnopenurl;
});
});
}, false);
</script>
<span style="display: none">
<script type="text/javascript" src="http://tajs.qq.com/stats?sId=34915524" charset="UTF-8"></script>
</span>
</body></html>
CSS
源码:
@CHARSET "UTF-8";#bdshare ul,#bdshare_s ul,#bdshare ul li,#bdshare_s ul li,#bdshare_l_c ul li,#bdshare_m_c ul li,#bdshare_pop ul,#bdshare_pop ul li{list-style:none;margin:0;padding:0}#bdshare{_overflow-x:hidden;z-index:999999;padding-bottom:2px;font-size:12px;float:left;text-align:left!important;zoom:1}#bdshare a,#bdshare_s a,#bdshare_pop a{text-decoration:none;cursor:pointer}#bdshare a:hover,#bdshare_s a:hover,#bdshare_pop a:hover{color:#333;opacity:.8;filter:alpha(opacity=80)}#bdshare img{border:0;margin:0;padding:0;cursor:pointer}#bdshare h6,#bdshare_s h6{width:100%;font:14px/22px '宋体';text-indent:.5em;font-weight:700;border-top:1px solid #fbfbfb;border-bottom:1px solid #f2f1f1;background-color:#f6f6f6;float:left;padding:5px 0;margin:0}#bdshare ul,#bdshare_s ul{width:98%;float:left;padding:8px 0;margin-left:2px;overflow:hidden}#bdshare ul li,#bdshare_s ul li{width:47%;_width:41%;float:left;margin:4px 2px}#bdshare ul li a,#bdshare_s ul li a{color:#565656;font:12px '宋体';display:block;width:98%;padding:6px 0;text-indent:2.4em;*text-indent:1.8em;_text-indent:1.8em;border:1px solid #fff}#bdshare ul li a:hover,#bdshare_s ul li a:hover{background-color:#f3f3f3;border:1px solid #eee;-webkit-border-radius:3px;-moz-border-radius:3px}#bdshare p,#bdshare_s p{width:100%;height:21px;font:12px '宋体';border-top:1px solid #f2f1f1;background-color:#f8f8f8;float:left;padding:0;margin:0}#bdshare p a,#bdshare_s p a{width:auto;text-align:right;float:right;padding:0 5px}#bdshare_l{width:212px;position:absolute;top:0;background:#fff;text-align:left}#bdshare_l_c{width:210px;float:left;border:1px solid #e9e9e9;text-align:left}#bdshare_l_c ul li{width:47%;height:26px;float:left;margin:2px}#bdshare_l_c ul li a{background:url(../images/is.png?cdnversion=20131219) no-repeat;height:auto!important}#bdshare_m{width:132px;float:right;position:absolute;zoom:1;background:#fff}#bdshare_m_c{width:130px;float:left;border:1px solid #e9e9e9;overflow:hidden;background:#fff}#bdshare_m_c ul li{width:97%;_width:90%;float:left;margin:2px}#bdshare_m_c ul li a{background:url(../images/is.png?cdnversion=20131219) no-repeat;height:auto!important}#bdshare_l,#bdshare_m{-webkit-box-shadow:0 0 7px #eee;-moz-box-shadow:0 0 7px #eee;z-index:99999}#bdshare_pop{width:300px;border:6px solid #8f8f8f;padding:0;background:#f6f6f6;position:absolute;z-index:1000000;text-align:left}#bdshare_pop{-webkit-border-radius:5px;-moz-border-radius:5px}#bdshare_pop{-webkit-box-shadow:0 0 7px #aaa;-moz-box-shadow:0 0 7px #aaa}#bdshare_pop div{border:1px solid #e9e9e9;float:left;overflow:hidden;text-align:left}#bdshare_pop h5{width:100%;height:28px;color:#626262;font:14px/28px '宋体';font-weight:700;text-indent:.5em;float:left;margin:0;overflow:hidden}#bdshare_pop h5 b{width:22px;height:23px;background:url(../images/pop_c.gif?cdnversion=20120720) no-repeat 0 0;cursor:pointer;position:absolute;right:8px;top:4px}#bdshare_pop ul{width:100%;height:256px;background:#fff;float:left;padding:8px 0;margin:0;border-top:1px solid #f2f1f1;border-bottom:1px solid #f2f1f1;overflow:auto;overflow-x:hidden}#bdshare_pop ul li{width:130px;float:left;padding:2px;margin-left:6px;_margin-left:3px;height:29px;overflow:hidden}#bdshare_pop ul li a{background:url(../images/is.png?cdnversion=20131219) no-repeat;color:#565656;font:12px '宋体';display:block;width:75%;padding:6px 0 6px 28px;border:1px solid #fff}#bdshare_pop ul li a:hover{background-color:#f3f3f3;border:1px solid #eee;-webkit-border-radius:3px;-moz-border-radius:3px}#bdshare_pop p{width:100%;font:12px '宋体';float:left;padding:5px 0 8px;margin:0;overflow:hidden}#bdshare_pop p a{width:auto;text-align:right;float:right;padding:0 5px}#bdshare_l_c p a.goWebsite,#bdshare_m_c p a.goWebsite,#bdshare_pop p a.goWebsite{text-align:right;background:url(../images/pi.gif?cdnversion=20120720) no-repeat 0 center;line-height:16px;padding-left:12px;color:#8c8c8c}#bdshare_l_c p a.goWebsite:hover,#bdshare_m_c p a.goWebsite:hover,#bdshare_pop p a.goWebsite:hover{color:#00a9e0}span.bds_more{background:url(../images/is.png?cdnversion=20131219) no-repeat 0 5px!important}span.bds_more,.bds_tools a{display:block;font-family:'宋体',Arial;height:16px;float:left;cursor:pointer;padding-top:6px;padding-bottom:3px;padding-left:22px}.bds_tools a{background:url(../images/is.png?cdnversion=20131219) no-repeat}.bds_tools_32 a{background:url(../images/is_32.png?cdnversion=20131219) no-repeat;width:37px;height:37px;display:block;float:left;margin-right:3px;text-indent:-100em;cursor:pointer}.bds_tools_32 span.bds_more{background:url(../images/is_32.png?cdnversion=20131219) no-repeat 0 5px!important;width:37px;height:32px;text-indent:-100em;padding-left:0}.bds_tools_24 a{background:url(../images/is_24.png?cdnversion=20131219) no-repeat;width:29px;height:29px;display:block;float:left;margin-right:3px text-indent:-100em;padding-left:0;cursor:pointer}.bds_tools_24 span.bds_more{background:url(../images/is_24.png?cdnversion=20131219) no-repeat 0 5px!important;width:29px;height:24px;text-indent:-100em;padding-left:0}.bds_more{background-image:url(../images/is.png?cdnversion=20131219)!important;background-position:0 4px!important}span.bds_nopic,.bds_tools_32 span.bds_nopic,.bds_tools_24 span.bds_nopic{background-image:none!important;padding-left:3px!important}.bdshare_b img{float:left}.bdshare_b a.shareCount,.bds_tools a.shareCount,.bds_tools_32 a.shareCount,.bds_tools_24 a.shareCount{float:left;background:url(../images/sc.png?cdnversion=20120720) no-repeat!important;margin:0;padding:0;text-align:center;padding-left:5px;color:#454545;font-family:'宋体'!important}.bdshare_b a.shareCount,.bds_tools_24 a.shareCount{width:39px;height:24px;background-position:0 0;font-size:12px;line-height:24px;margin-left:3px}.bdshare_b a.shareCount:hover,.bds_tools_24 a.shareCount:hover{color:#454545!important;background-position:-44px 0!important;opacity:1!important;filter:alpha(opacity=100)!important}.bds_tools a.shareCount{width:37px;height:16px;background-position:0 -30px!important;margin-top:5px;overflow:hidden;font-size:12px;line-height:16px}.bds_tools a.shareCount:hover{color:#454545!important;background-position:-42px -30px!important;opacity:1!important;filter:alpha(opacity=100)!important}.bds_tools_32 a.shareCount{width:43px;height:32px;background-position:0 -60px!important;margin-top:5px;overflow:hidden;font-size:14px;line-height:32px;text-indent:0!important}.bds_tools_32 a.shareCount:hover{color:#454545!important;background-position:-48px -60px!important;background-position:-48px -60px;opacity:1!important;filter:alpha(opacity=100)!important}.bds_tools_24 a.shareCount{margin-top:5px}.bds_qzone{background-position:0 -75px!important}.bds_tsina{background-position:0 -115px!important}.bds_bdhome{background-position:0 -155px!important}.bds_renren{background-position:0 -195px!important}.bds_tqq{background-position:0 -235px!important}.bds_kaixin001{background-position:0 -275px!important}.bds_tqf{background-position:0 -315px!important}.bds_hi{background-position:0 -355px!important}.bds_douban{background-position:0 -395px!important}.bds_tsohu{background-position:0 -435px!important}.bds_msn{background-position:0 -475px!important}.bds_qq{background-position:0 -515px!important}.bds_taobao{background-position:0 -555px!important}.bds_tieba{background-position:0 -595px!important}.bds_sohu{background-position:0 -675px!important}.bds_t163{background-position:0 -715px!important}.bds_qy{background-position:0 -755px!important}.bds_tfh{background-position:0 -795px!important}.bds_hx{background-position:0 -835px!important}.bds_fx{background-position:0 -875px!important}.bds_ff{background-position:0 -915px!important}.bds_xg{background-position:0 -955px!important}.bds_ty{background-position:0 -995px!important}.bds_s51{background-position:0 -1035px!important}.bds_fbook{background-position:0 -1115px!important}.bds_twi{background-position:0 -1155px!important}.bds_ms{background-position:0 -1195px!important}.bds_deli{background-position:0 -1235px!important}.bds_s139{background-position:0 -1275px!important}.bds_iguba{background-position:0 -1315px!important}.bds_linkedin{background-position:0 -1354px!important}.bds_copy{background-position:0 -1393px!important}.bds_ifeng{background-position:0 -1431px!important}.bds_tuita{background-position:0 -1470px!important}.bds_meilishuo{background-position:0 -1549px!important}.bds_mogujie{background-position:0 -1589px!important}.bds_diandian{background-position:0 -1629px!important}.bds_huaban{background-position:0 -1669px!important}.bds_leho{background-position:0 -1709px!important}.bds_wealink{background-position:0 -1749px!important}.bds_duitang{background-position:0 -1789px!important}.bds_thx{background-position:0 -1829px!important}.bds_mail{background-position:0 -1870px!important}.bds_print{background-position:0 -1910px!important}.bds_baidu{background-position:0 -1950px!important}.bds_share189{background-position:0 -1990px!important}.bds_youdao{background-position:0 -2030px!important}.bds_mshare{background-position:0 -2070px!important}.bds_mop{background-position:0 -2110px!important}.bds_yaoshi{background-position:0 -2150px!important}.bds_bdxc{background-position:0 -2190px!important}.bds_sqq{background-position:0 -2230px!important}.bds_sdo{background-position:0 -2270px!important}.bds_qingbiji{background-position:0 -2310px!important}.bds_people{background-position:0 -2350px!important}.bds_kanshou{background-position:0 -2390px!important}.bds_xinhua{background-position:0 -2430px!important}.bds_yaolan{background-position:0 -2470px!important}.bds_isohu{background-position:0 -2510px!important}.bds_bdysc{background-position:0 -2550px!important}.bds_ibaidu{background-position:0 -2590px!important}#bdshare .bds_fl5,#bdshare .bds_buzz,#bdshare .bds_zx{display:none}
JS
源码:
(1)bds_s_v2.js
var bdShare=bdShare||{version:"1.0"};(function(){var P=new Date().getTime();var N=new Date().getTime();var L=new Date().getTime();var F=window,V=document,X=V.body,R=V.documentElement,A={},G="",I=V.title,h=[],O="",C={},S=V.getElementById("bdshare_js").attributes.data,K=/MSIE 6.0/.test(navigator.userAgent),g=V.compatMode!="CSS1Compat",S=S.nodeValue.replace(/&/g,"&").split("&")||"";try{var Y=F.location||V.location;A.href=Y.href;A.search=Y.search;A.hash=Y.hash;A.protocol=Y.protocol;A.hostname=Y.hostname;A.pathname=Y.pathname;G=encodeURIComponent(A.href)}catch(f){setTimeout(function(){var B=F.location||V.location;A.href=B.href;A.search=B.search;A.hash=B.hash;A.protocol=B.protocol;A.hostname=B.hostname;A.pathname=B.pathname;G=encodeURIComponent(A.href)},0)}for(var c=S.length;c--;){var b=S[c].split("=");h[b[0]]=b[1]}var Z={bdPref:"bds_",bdNums:h.mini?7:15,bdMini:h.mini||false,bdType:h.type||"",bdLeft:h.pos||"right",bdTitle:"\u5206\u4eab\u5230",bdText:I,weiboText:"",bdMore:"\u66f4\u591a...",bdPopTitle:"\u5206\u4eab\u5230",bdImg:h.img||0,bdImgW:24,bdTop:0,bdIds:"bdshare",bdIdsl:h.mini?"bdshare_m":"bdshare_l",bdUid:h.uid||"",bdPic:"",searchPic:h.searchPic||0,bdComment:"",bdDesc:"",wbUid:"",tongji:"on",review:"on",render:true,snsKey:{},bdHost:"http://bdimg.share.baidu.com/static/",bdJump:"http://share.baidu.com/",bdApi:"http://api.share.baidu.com/",bdStatistics:"http://share.baidu.com/commit",bdCommit:"http://s.share.baidu.com/",bdMshare:"http://s.share.baidu.com/mshare",bdCout:"http://nsclick.baidu.com/v.gif?pid=307",bdWList:"([http|https]://[a-zA-Z0-9_.]+.baidu.com)",bdList:["mshare,\u4e00\u952e\u5206\u4eab,mshare","qzone,QQ\u7a7a\u95f4,qqkj","tsina,\u65b0\u6d6a\u5fae\u535a,xlwb","bdysc,\u767E\u5EA6\u4E91\u6536\u85CF,bdysc","renren,\u4eba\u4eba\u7f51,rrw","tqq,\u817e\u8baf\u5fae\u535a,txwb","bdxc,\u767e\u5ea6\u76f8\u518c,bdxc","kaixin001,\u5f00\u5fc3\u7f51,kxw","tqf,\u817e\u8baf\u670b\u53cb,txpy","tieba,\u767e\u5ea6\u8d34\u5427,bdtb","douban,\u8c46\u74e3\u7f51,db","tsohu,\u641c\u72d0\u5fae\u535a,shwb","bdhome,\u767e\u5ea6\u65b0\u9996\u9875,bdhome","sqq,QQ\u597D\u53CB,sqq","thx,\u548c\u8baf\u5fae\u535a,thx","qq,QQ\u6536\u85cf,qqsc","ibaidu,\u767E\u5EA6\u4E2A\u4EBA\u4E2D\u5FC3,ibaidu","taobao,\u6211\u7684\u6dd8\u5b9d,tjh","hi,\u767e\u5ea6\u7a7a\u95f4,bdkj","baidu,\u767E\u5EA6\u641C\u85CF,bdsc","sohu,\u641c\u72d0\u767d\u793e\u4f1a,shbsh","t163,\u7f51\u6613\u5fae\u535a,wywb","qy,\u5947\u827a\u5947\u8c08,qyqt","meilishuo,\u7f8e\u4e3d\u8bf4,mls","mogujie,\u8611\u83c7\u8857,mgj","diandian,\u70b9\u70b9\u7f51,diandian","huaban,\u82b1\u74e3,huaban","leho,\u7231\u4e50\u6d3b,leho","share189,\u624B\u673A\u5FEB\u4F20,share189","duitang,\u5806\u7cd6,duitang","hx,\u548c\u8baf,hexun","tfh,\u51e4\u51f0\u5fae\u535a,fhwb","fx,\u98de\u4fe1,feixin","youdao,\u6709\u9053\u4e91\u7b14\u8bb0,youdao","sdo,\u9EA6\u5E93\u8BB0\u4E8B,sdo","qingbiji,\u8F7B\u7B14\u8BB0,qingbiji","ifeng,\u51E4\u51F0\u5FEB\u535A,ifeng","people,\u4EBA\u6C11\u5FAE\u535A,people","xinhua,\u65B0\u534E\u5FAE\u535A,xinhua","ff,\u996d\u5426,fanfou","mail,\u90ae\u4ef6\u5206\u4eab,mail","kanshou,\u641C\u72D0\u968F\u8EAB\u770B,kanshou","isohu,\u6211\u7684\u641C\u72D0,isohu","yaolan,\u6447\u7BEE\u7A7A\u95F4,yaolan","wealink,\u82e5\u90bb\u7f51,wealink","xg,\u9c9c\u679c,xianguo","ty,\u5929\u6daf\u793e\u533a,tianya","iguba,\u80A1\u5427,iguba","fbook,Facebook,facebook","twi,Twitter,twitter","deli,delicious,delicious","s51,51\u6E38\u620F\u793e\u533a,51shequ","s139,139\u8bf4\u5ba2,shuoke","linkedin,linkedin,LinkedIn","copy,\u590d\u5236\u7f51\u5740,kaobei","print,\u6253\u5370,print"]}||{},J={_parseJson:function(j){if(typeof j!="string"){return j}j=j.replace(/^\s*{|}\s*$/g,"");var e=j.split(",");var k={};function D(r){if(r.indexOf("{")==0){return J._parseJson(r)}else{var q=r.split(".");var s=window;for(var p=0,o=q.length;p<o;p++){var t=q[p];if(typeof s=="object"&&t in s){s=s[t]}else{return r}}return s}}for(var T=0,W=e.length;T<W;T++){var n=e[T];var U=n.indexOf(":");if(U){var m=n.substring(0,U).replace(/^\s*[\'\"]?|[\"\']?\s*$/g,"");var B=n.substring(U+1).replace(/^\s*/g,"");var l=B.charAt(0);if(l=="'"||l=='"'){do{var E=B.replace(/\s*$/g,"");if(E.substring(E.length-1)==l){break}else{B=B+","+e[++T]}}while(T<e.length-1);B=B.replace(/^\s*[\'\"]?|[\"\']?\s*$/g,"")}else{if(l=="{"){do{var E=B.replace(/\s*$/g,"");if(E.substring(E.length-1)=="}"){break}else{B=B+","+e[++T]}}while(T<e.length-1);B=D(B)}else{if(!/^[0-9]*$/.test(B)){B=D(B)}else{B=B.replace(/^\s*[\'\"]?|[\"\']?\s*$/g,"")}}}k[m]=B}}return k},_createScriptTag:function(D,B,E){D.setAttribute("type","text/javascript");E&&D.setAttribute("charset",E);D.setAttribute("src",B);document.getElementsByTagName("head")[0].appendChild(D)},_removeScriptTag:function(D){if(D.clearAttributes){D.clearAttributes()}else{for(var B in D){if(D.hasOwnProperty(B)&&"parentNode"!=B){delete D[B]}}}if(D&&D.parentNode){D.parentNode.removeChild(D)}D=null},callByBrowser:function(i,W,T){var E=document.createElement("SCRIPT"),U=0,l=T||{},D=l.charset,k=W||function(){},j=l.timeOut||0,B;E.onload=E.onreadystatechange=function(){if(U){return }var e=E.readyState;if("undefined"==typeof e||e=="loaded"||e=="complete"){U=1;try{k();clearTimeout(B)}finally{E.onload=E.onreadystatechange=null;J._removeScriptTag(E)}}};if(j){B=setTimeout(function(){E.onload=E.onreadystatechange=null;J._removeScriptTag(E);l.onfailure&&l.onfailure()},j)}J._createScriptTag(E,i,D)},on:function(E,B,D){if(E.addEventListener){E.addEventListener(B,D,false)}else{if(E.attachEvent){E.attachEvent("on"+B,D)}}},unon:function(E,B,D){if(E.removeEventListener){E.removeEventListener(B,D,false)}else{if(E.detachEvent){E.detachEvent("on"+B,D)}}},html:function(D,B){var T=V.createElement(B||"div");for(var E in D){E=="style"?T[E].cssText=D[E]:T[E]=D[E]}if(B=="link"){V.getElementsByTagName("head")[0].appendChild(T)}else{return X.insertBefore(T,(B=="iframe"?X.firstChild:O.nextSibling))}},list:function(E){var T=Z.bdPref,B=E.split(","),W=B[1],D="#",U=T+B[0]+" "+B[2];return{name:W,url:D,cls:U}},list_s:function(j){var i=[],U=inner="",W=Z,B=W.bdList,E=W.bdNums,e=(W.bdNums<B.length)?'<li><a href="#" class="bds_more">'+W.bdMore+"</a></li>":"";while(E--){U=J.list(B[E]),i.push('<a href="'+U.url+'" class="'+U.cls+'">'+U.name+"</a>")}inner='<iframe id="bdsIfr" style="position:absolute;display:none;z-index:9999;" frameborder="0"></iframe>';inner+='<div id="'+W.bdIdsl+'"><div id="'+W.bdIdsl+'_c"><h6>'+W.bdTitle+"</h6>";inner+="<ul><li>"+i.reverse().join("</li><li>")+"</li>"+e+'</ul><p><a href="#" class="goWebsite">\u767e\u5ea6\u5206\u4eab</a></p></div></div>';if(j){var T=J.html({id:"bdshare_s",innerHTML:inner,style:"display:none"});T.style.display="block";var D=J.children(T);T=D[D.length-1];J.on(T,"mouseover",function(p){var p=p||window.event;var o=p.target||p.srcElement;var n=J.getPosition(o);var m=p.relatedTarget||p.fromElement;var l=J.getMousePos(p);var k=l.x-n.l;var q=l.y-n.t;o.buttontype=1;o.x=k;o.y=q;if(J.contains(T,m)){return }T.time=+new Date})}else{return inner}},scroll:function(B,D){J.on(F,"scroll",function(W){var E=J.getSize(),T=Z,U=T.bdTop;if(T.bdType=="slide"){if(K||g){J.setAttr(V.getElementById(T.bdIdsl),"display:block");_bdS.style.top=(E.t+(U==0?(E.h/2-(V.getElementById(T.bdIdsl).offsetHeight-11)/2):parseInt(U)))+"px"}else{if(T.bdTop!=0){_bdS.style.top=parseInt(T.bdTop)+"px"}}}if(D=="pop"&&(K||g)){B.style.top=(E.t+E.h/2-B.offsetHeight/2)+"px";J.setAttr(O,"top:"+B.style.top)}})},getSize:function(){return{t:(X.scrollTop||R.scrollTop),l:(X.scrollLeft||R.scrollLeft),w:(R.clientWidth||X.clientWidth),h:(F.innerHeight||R.clientHeight||X.clientHeight)}},getPosition:function(q){var u=J.getSize(),D=q,n={t:0,l:0},B=/gecko/.test(navigator.userAgent),m=function(o,e){n.t+=o,n.l+=e};if(D&&D!=X){if(D.getBoundingClientRect){var p=D.getBoundingClientRect(),r=q.ownerDocument,W=r.body,T=r.documentElement,E=T.clientTop||W.clientTop||0,k=T.clientLeft||W.clientLeft||0;if(p.top==p.bottom){var U=D.style.display;D.style.display="block";D.style.display=U}m(p.top+u.t-E,p.left+u.l-k)}else{var l=V.defaultView;while(D){m(D.offsetTop,D.offsetLeft);var j=l.getComputedStyle(D,null);if(B){var i=parseInt(j.getPropertyValue("border-left-width"),10)||0,t=parseInt(j.getPropertyValue("border-top-width"),10)||0;m(t,i);if(D!=q&&j.getPropertyValue("overflow")!="visible"){m(t,i)}}D=D.offsetParent}D=q.parentNode;while(D&&D!=X){m(-D.scrollTop,-D.scrollLeft);D=D.parentNode}}}return n},setAttr:function(E,D){var T=D.split(";"),B=T.length;while(B--){if(T[B]){var U=T[B].split(":");if(U){E.style[U[0]]=U[1]}}}},children:function(E){for(var B=[],D=E.firstChild;D;D=D.nextSibling){if(D.nodeType==1){B.push(D)}}return B},generateRandom:function(U,W){var B=U.length;var E="";for(var D=1;D<=W;D++){var T=Math.floor(B*Math.random());E=E+U.charAt(T)}return E},generateLinkid:function(){var D=(+new Date).toString(36);var B=J.generateRandom("0123456789abcdefghijklmnopqrstuvwxyz",3);return D+B},contains:function(D,E){if(!E||!D){return false}if(D==E){return true}var B=E.parentNode;while(B!=null&&typeof (B.tagName)!="undefind"){if(B==D){return true}B=B.parentNode}return false},getMousePos:function(B){if(B.pageX||B.pageY){return{x:B.pageX,y:B.pageY}}if(document.documentElement&&document.documentElement.scrollTop){return{x:B.clientX+document.documentElement.scrollLeft-document.documentElement.clientLeft,y:B.clientY+document.documentElement.scrollTop-document.documentElement.clientTop}}else{if(document.body){return{x:B.clientX+document.body.scrollLeft-document.body.clientLeft,y:B.clientY+document.body.scrollTop-document.body.clientTop}}}},_isCookieValidKey:function(B){return(new RegExp('^[^\\x00-\\x20\\x7f\\(\\)<>@,;:\\\\\\"\\[\\]\\?=\\{\\}\\/\\u0080-\\uffff]+\x24')).test(B)},getCookieRaw:function(D){if(J._isCookieValidKey(D)){var E=new RegExp("(^| )"+D+"=([^;]*)(;|\x24)"),B=E.exec(document.cookie);if(B){return B[2]||null}}return null},setCookieRaw:function(E,T,D){if(!J._isCookieValidKey(E)){return }D=D||{};var B=D.expires;if("number"==typeof D.expires){B=new Date();B.setTime(B.getTime()+D.expires)}document.cookie=E+"="+T+(D.path?"; path="+D.path:"")+(B?"; expires="+B.toGMTString():"")+(D.domain?"; domain="+D.domain:"")+(D.secure?"; secure":"")},getCookie:function(B){var D=J.getCookieRaw(B);if("string"==typeof D){D=decodeURIComponent(D);return D}return null},setCookie:function(D,E,B){J.setCookieRaw(D,encodeURIComponent(E),B)},log:(function(){var B=[];return function(D){var T="bdsharelog__"+(new Date()).getTime(),E=B[T]=new Image();E.onload=(E.onerror=function(){B[T]=null});E.src=D;E=null}})()},M=function(B){var D=V.createElement("link");bdShare.velocity=bdShare.velocity||{};bdShare.velocity.cssLoadStart=+new Date();D.onload=function(){bdShare.velocity.cssLoadEnd=+new Date()};D.href=Z.bdHost+"css/bdsstyle.css?cdnversion=20131219";D.rel="stylesheet";D.type="text/css";V.getElementsByTagName("head")[0].appendChild(D);O=O||J.html({style:"display:none;"+(B||""),frameBorder:0},"iframe")},Q=function(j,n,m,B){var l=/(#\d+\-[a-zA-Z\d]+\-\d+\-\d+\-[a-f\d]{32}$)/g,T=(A.search+A.hash).replace(/&/g,"#"),D=T.match(l)||"",o=new RegExp(Z.bdWList,"ig"),e=A.protocol+"//"+A.hostname+A.pathname+A.search;if(o.test(A.href)&&D==""&&typeof j=="undefined"){return }var k=[];if(bdShare.fn.b.length>0){k.push("button")}if(bdShare.fn.t.length>0){k.push("tools")}if(bdShare.fn.conf.bdType){k.push(bdShare.fn.conf.bdType)}var W=(function(){for(var s=0,q=k.length,t={},r=[];s<q;s++){!(k[s] in t)&&r.push(k[s])&&(t[k[s]]="")}return r.join(",")})();if(Z.tongji=="on"||D!=""||typeof j!="undefined"){if(D!=""&&j!="3072"){D=D.toString().replace("#","");(new Image()).src=Z.bdCommit+"back?url="+encodeURIComponent(e)+"&sign="+encodeURIComponent(D)+"&title="+encodeURIComponent(I.substr(0,300))}bdShare.velocity=bdShare.velocity||{};bdShare.velocity.mainJsLoaded=+new Date();if(typeof j!="undefined"){(new Image()).src=Z.bdCout+"&type="+j+"&sign="+D+"&uid="+Z.bdUid+"&desturl="+encodeURIComponent(V.referrer)+"&linkid="+H+"&button="+W}else{var p=[0,0,0,0];for(var E=0,U=k.length;E<U;E++){p[{tools:0,button:1,slide:2}[k[E]]]=1}bdShare._LogPool=bdShare._LogPool||[];bdShare._LogPool.push({key:"cite",api:{uid:Z.bdUid||"",linkid:H,type:parseInt(p.reverse().join(""),2),mini:Z.bdMini?1:0}})}}},d={create:function(){var i=Z,k=i.bdList,D=k.length,T=[],E="",l=J.getSize(),B=V.getElementById(i.bdIds+"_pop"),e=((K||g)?"absolute":"fixed"),j=((K||g)?l.t:0);if(!B){while(D--){E=J.list(k[D]),T.push('<a href="'+E.url+'" class="'+E.cls+'">'+E.name+"</a>")}var W=J.html({id:i.bdIds+"_pop",style:"position:"+e,innerHTML:"<div><h5></h5><ul><li>"+T.reverse().join("</li><li>")+'</li></ul><p><a href="#" class="goWebsite">\u767e\u5ea6\u5206\u4eab</a></p></div>'});a.bind(W,"mouseover","a");a.bind(W,"click","b",function(){W.style.display="none";O.style.display="none"});J.on(W,"mouseover",function(r){var r=r||window.event;var q=r.target||r.srcElement;var p=J.getPosition(q);var n=J.getMousePos(r);var m=n.x-p.l;var s=n.y-p.t;q.buttontype=2;q.x=m;q.y=s;var o=r.relatedTarget||r.fromElement;if(J.contains(W,o)){return }W.time=+new Date})}var U=W||B;U.getElementsByTagName("h5")[0].innerHTML=(C.title||i.bdPopTitle)+"<b> </b>";J.setAttr(U,"display:block;");J.setAttr(U,"left:"+(l.w/2-U.offsetWidth/2)+"px;top:"+(j+l.h/2-U.offsetHeight/2)+"px");J.setAttr(O,"position:"+e+";display:block;z-index:10000;width:"+U.offsetWidth+"px;height:"+U.offsetHeight+"px;left:"+U.style.left+";top:"+U.style.top);J.scroll(U,"pop");J.on(F,"resize",function(o){var m=J.getSize(),n="left:"+(m.w/2-U.offsetWidth/2)+"px;top:"+(j+m.h/2-U.offsetHeight/2)+"px";J.setAttr(U,n);J.setAttr(O,n)});if(i.bdType!="slide"){V.getElementById(Z.bdIdsl).style.display="none";V.getElementById("bdsIfr").style.display="none"}window.bdShareActivity&&bdShareActivity.check()}},a={bind:function(D,B,U,T){var E=this;D.addEventListener?D.addEventListener(B,function(W){return E._action(W,W.target,U,D,T)},false):D.attachEvent("on"+B,function(W){W=F.event;return E._action(W,W.srcElement,U,D,T)})},_action:function(W,B,i,U,T){if(B.nodeName==i.toUpperCase()){if(i=="a"||i=="span"){var j=B.className,D=j=="goWebsite"?j:j.split(" ")[0].split("_")[1],E=this;if(D){(D=="more"&&i=="span")?E._tools():B.onclick=function(k,e){return function(p){var p=p||window.event;var o=p.target||p.srcElement;var n=J.getPosition(o);var m=J.getMousePos(p);var l=m.x-n.l;var q=m.y-n.t;if(k=="more"){E._tools()}else{if(k=="copy"){E._copy(E)}else{if(k=="print"){E._print()}else{E._jump(k,e,B,l,q)}}}return false}}(D,U)}return false}if(typeof T==="function"){T()}}if(typeof W.preventDefault==="function"){W.preventDefault();W.stopPropagation()}else{W.returnValue=false;W.cancelBubble=true}},_tools:function(){Q(3072);d.create()},_copy:function(D){_this=D;var B=new _this._browsers();if(B.name=="IE"){window.clipboardData.setData("text",document.title+" "+A.href);alert("\u6807\u9898\u548c\u94fe\u63a5\u590d\u5236\u6210\u529f\uff0c\u60a8\u53ef\u4ee5\u63a8\u8350\u7ed9QQ/MSN\u4e0a\u7684\u597d\u53cb\u4e86\uff01")}else{window.prompt("\u60a8\u4f7f\u7528\u7684\u662f\u975eIE\u6838\u5fc3\u6d4f\u89c8\u5668\uff0c\u8bf7\u6309\u4e0b Ctrl+C \u590d\u5236\u4ee3\u7801\u5230\u526a\u8d34\u677f",document.title+" "+A.href)}},_mail:function(B){},_print:function(){var B=document.getElementById("bdshare_pop");B&&(B.style.display="none");window.print();B&&(B.style.display="block");return },_jump:function(AX,AW,B,AE,AD){var AV=Z,AC=AV.bdPic,W=AV.bdText,AA=AV.weiboText,AM=AV.wbUid,e=G,AL=AV.bdDesc,v=AV.bdComment,p=AV.bdMiniWindow||0;C=(AW.getAttribute("data")&&AW.getAttribute("data")!="")?J._parseJson(AW.getAttribute("data")):C;if(C!=""){AC=encodeURIComponent(C.pic||"")||AC;e=encodeURIComponent(C.url||"")||e;v=encodeURIComponent(C.comment||"")||v;AL=encodeURIComponent(C.desc||"")||AL;AM=C.wbuid||AM;if(AX=="tsina"){if(C.text&&C.weibotext){W=encodeURIComponent((C.text+C.weibotext).substr(0,300))}else{if(C.weibotext){W=encodeURIComponent((W+C.weibotext).substr(0,300))}else{if(C.text){W=encodeURIComponent((C.text+AA).substr(0,300))}else{W=encodeURIComponent((W+AA).substr(0,300))}}}}else{W=encodeURIComponent((C.text||"").substr(0,300))||encodeURIComponent(W.substr(0,300))}}else{if(AX=="tsina"){W=encodeURIComponent((W+AA).substr(0,300))}else{W=encodeURIComponent(W.substr(0,300))}}L=new Date().getTime()+3000;var AP=P.toString(32)+N.toString(32)+L.toString(32);var AZ=B.buttontype;var U=Math.floor(bdShare.XY.loadedX);var T=Math.floor(bdShare.XY.loadedY);var o=AZ>0?1:0;var AI=Math.floor(B.x);var AF=Math.floor(B.y);var j=Math.floor(AE);var i=Math.floor(AD);var AG=Math.floor(B.offsetWidth);var AS=Math.floor(B.offsetHeight);var q=document.body.offsetWidth;var AB=document.body.offsetHeight;var u=window.screen.availWidth;var AH=window.screen.availHeight;var n=AZ;var AJ=+new Date;AJ=AJ-AW.time;var k=[U,T,o,AI,AF,j,i,AG,AS,n,AJ,q,AB,u,AH].join(".");var D;switch(Z.bdType){case"button":D=1;break;case"slide":D=2;break;default:D=0;break}var AY=AX=="mail"?"_mail":AX;var r="?click=1&url="+e+"&uid="+AV.bdUid+"&to="+AY+"&type=text&relateUid="+AM+"&pic="+AC+"&title="+W+"&key="+(AV.snsKey[AX]||"")+"&sign="+AV.review+"&desc="+AL+"&comment="+v+"&searchPic="+AV.searchPic+"&l="+AP+"&linkid="+H+"&sloc="+k+"&apiType=0&buttonType="+D+"&firstime="+J.getCookie("bdshare_firstime");if(AX=="mshare"){var AU=AV.bdMshare+r}else{var AU=AV.bdCommit+r}var z=AV.bdCommit+"commit"+r+"&t="+Math.random();if(AX!="goWebsite"){bdShare.fn._getSc("share");var AR=function(){var l=[];return function(s){var m=l.push(new Image)-1;l[m].onload=function(){l[m]=l[m].onload=null};l[m].src=s}}();setTimeout(function(){AR(z)},1500);if(AX=="bdxc"){var AT=window,AU=document,AO="_bdXC",AK;if(AT[AO]){if(window._bdXC_loaded){AT[AO].reInit()}}else{AK=AU.createElement("script");AK.setAttribute("charset","utf-8");AK.src="http://xiangce.baidu.com/zt/collect/mark.js?"+(new Date()).getTime();AU.getElementsByTagName("head")[0].appendChild(AK)}}else{if(AX=="bdysc"){var E={url:e,title:W};if(window.baiduSC_yaq4d3elabjnvmijccc1zuo3o4yeizck){window.baiduSC_yaq4d3elabjnvmijccc1zuo3o4yeizck.go(E)}else{window.baiduSC_yaq4d3elabjnvmijccc1zuo3o4yeizck={callback:function(){this.go(E)}};var AN=document.createElement("script");AN.src="http://s.wenzhang.baidu.com/js/pjt/content_ex/page/bookmark.js?s=baidu_fenxiang&_t="+Math.random();document.getElementsByTagName("body")[0].appendChild(AN)}}else{if(AX=="mail"){var AQ=Z.bdCommit+"sendmail";window.open(AQ+r,"_blank")}else{if(1==p){F.open(AU,"bdShare","toolbar=0, scrollbars=1, status=0, resizable=1, height=400, width=600")}else{F.open(AU)}}}}}else{F.open(AV.bdJump)}},_browsers:function(){var D={};var B=navigator.userAgent.toLowerCase();var T,E;if(B.match(/msie ([\d.]+)/)){E=B.match(/msie ([\d.]+)/);D.name="IE";D.version=E[1]}else{if(B.match(/firefox\/([\d.]+)/)){E=B.match(/firefox\/([\d.]+)/);D.name="firefox";D.version=E[1]}else{if(B.match(/chrome\/([\d.]+)/)){E=B.match(/chrome\/([\d.]+)/);D.name="chrome";D.version=E[1]}else{if(B.match(/opera.([\d.]+)/)){E=B.match(/opera.([\d.]+)/);D.name="opera";D.version=E[1]}else{if(B.match(/safari.([\d.]+)/)){E=B.match(/safari.([\d.]+)/);D.name="safari";D.version=E[1]}else{D.name="\u672a\u77e5\u7684\u6d4f\u89c8\u5668";D.version="\u672a\u77e5\u7684\u7248\u672c\u53f7"}}}}}return D}};var H=J.generateLinkid();bdShare.fn=(function(){return{init:function(){N=new Date().getTime()+1000;this.b=[];this.t=[];this.s=[];this.type="load";this._getShare();var E=this;if(typeof bds_config!="undefined"){for(var k in bds_config){if(k=="bdPopTitle"||k=="bdText"||k=="weiboText"||k=="bdPic"||k=="wbUid"||k=="tongji"||k=="render"||k=="snsKey"||k=="review"||k=="bdComment"||k=="bdDesc"||k=="bdTop"||k=="searchPic"||k=="bdUrl"||k=="bdMiniWindow"){if(k=="snsKey"){Z[k]=J._parseJson(bds_config[k])}else{Z[k]=(k=="render"||k=="bdPopTitle"||k=="bdText"||k=="weiboText")?bds_config[k]:encodeURIComponent(bds_config[k])}}}}this.conf=Z;this.imgW=Z.bdImgW;if(this.conf.render){if(this.b.length>0||this.t.length>0){this._share()}if(this.conf.bdType=="slide"){this._slide()}}this._getSc(this.type);var W=this.t;for(var U=0;U<W.length;U++){var e=W[U].getElementsByTagName("a");for(var T=0;T<e.length;T++){!(e[T].getAttribute("href"))&&e[T].setAttribute("href","#")}}bdShare.XY=bdShare.XY||{};function D(j){var j=j||window.event;var i=J.getMousePos(j);bdShare.XY.loadedX=i.x;bdShare.XY.loadedY=i.y;if(bdShare.XY.loadedX>0&&bdShare.XY.loadedY>0){J.unon(document,"mousemove",D)}}J.on(document,"mousemove",D);for(var U=0,B=this.t.length;U<B;U++){(function(i){var j=i;J.on(E.t[i],"mouseover",function(q){var q=q||window.event;var p=q.target||q.srcElement;var o=J.getPosition(p);var m=J.getMousePos(q);var l=m.x-o.l;var r=m.y-o.t;p.buttontype=0;p.x=l;p.y=r;var n=q.relatedTarget||q.fromElement;if(J.contains(E.t[j],n)){return }E.t[j].time=+new Date})})(U)}Q();if(J.getCookie("bdshare_firstime")==null){J.setCookie("bdshare_firstime",new Date()*1,{path:"/",expires:new Date().setFullYear(2022)-new Date()})}},_getSc:function(D){this.type=D;var E=V.querySelectorAll?V.querySelectorAll(".shareCount"):V.getElementsByTagName("*"),B=E.length;while(B--){if(/\sshareCount|shareCount\s|shareCount$/.test(E[B].className)){this.s.push(E[B])}}if(this.s.length>0){J.callByBrowser(this.conf.bdApi+"getnum?url="+G+"&callback=bdShare.fn._getShare&type="+D+"&t="+new Date().getTime())}},_getShare:function(T){var E=T?true:false,j=[];if(V.querySelectorAll){this.b=V.querySelectorAll(".bdshare_b");this.t=V.querySelectorAll(".bdshare_t")}else{var i=V.getElementsByTagName("*"),D=i.length;while(D--){var U=i[D];if(/\sbdshare_t|bdshare_t\s/.test(U.className)){this.t.push(U)}if(/\sbdshare_b|bdshare_b\s|bdshare_b$/.test(U.className)){this.b.push(U)}}}if(E){var j=this.s,B=j.length,W;while(B--){if(/\sshareCount|shareCount\s|shareCount$/.test(j[B].className)){W=this.type=="share"?(T.num[0]<10000?parseInt(j[B].innerHTML)+1:T.num[1]):(T.errno*1==0?T.num[1]:0);j[B].innerHTML=decodeURI(W);j[B].setAttribute("title","\u7d2f\u8ba1\u5206\u4eab"+T.num[0]+"\u6b21");j[B].onclick=function(){d.create()}}}this.s=[]}},_share:function(){J.list_s(true);var i=this.b,q=this.t,D=i.length,r=q.length,B=V.getElementById(this.conf.bdIdsl),E=V.getElementById("bdsIfr"),k=this.conf.bdList,n=k.length;J.setAttr(B,"display:none;");a.bind(B,"mouseover","a");if(D>0){while(D--){if(i[D].id=="bdshare"){a.bind(i[D],"click","img",function(){d.create()});a.bind(i[D],"mouseover","a",function(){d.create()});this._s(i[D],B,E,i[D],"b")}}}if(r>0){while(r--){if(q[r].id=="bdshare"){a.bind(q[r],"click","span",function(){d.create()});a.bind(q[r],"mouseover","a");var j=J.children(q[r]),U=j.length,u="";while(U--){var e=j[U];if(/bds_more/.test(e.className)){u=j[U];if(g){u.style.height=(/bds_tools_32/.test(q[r].className)?38:17)+"px"}this._s((u==""?q[r]:u),B,E,q[r],u)}else{for(var T=0;T<n;T++){if(k[T]){var W=k[T].split(","),o=new RegExp(this.conf.bdPref+W[0]+"$","ig");if(k[T]){var W=k[T].split(","),o=new RegExp(this.conf.bdPref+W[0]+"$","ig");if(o.test(e.className)){if(W[1]=="拷贝"){e.title="复制网址"}else{if(!e.title){e.title="\u5206\u4eab\u5230"+W[1]}}}}}}}}}}}},_s:function(W,B,D,U,j){var E=this,T=[],i,e=(j==""?"none":"block");this._popShow(W,{over:function(k){T=J.getPosition(W);C=(U.getAttribute("data")&&U.getAttribute("data")!="")?J._parseJson(U.getAttribute("data")):"";J.setAttr(B,"display:"+e);J.setAttr(B,"left:"+(((J.getSize().w-k.clientX)<B.offsetWidth)?(T.l-B.offsetWidth+W.offsetWidth):T.l)+"px");J.setAttr(B,"top:"+(((J.getSize().h-k.clientY)<B.offsetHeight)?(T.t-B.offsetHeight):T.t+W.offsetHeight)+"px");J.setAttr(D,"display:"+e+";width:"+B.offsetWidth+"px;height:"+B.offsetHeight+"px;left:"+B.style.left+";top:"+B.style.top)},out:function(k){i=setTimeout(function(){B.style.display="none";D.style.display="none"},100);E._popShow(B,{over:function(){clearTimeout(i);B.style.display="block";D.style.display="block"},out:function(){B.style.display="none";D.style.display="none"}})}})},_slide:function(){if(!F._bdS){var k=this.conf.bdLeft=="right"?"left":"right",e=this.conf.bdHost+"images/"+this.conf.bdLeft.substring(0,1)+this.conf.bdImg+".gif";F._bdS=J.html({id:this.conf.bdIds,innerHTML:'<img src="'+e+'" alt="" style="float:'+k+';margin-top:58px;"/>'+J.list_s(false)});var D=J.children(_bdS);var B=D[D.length-1];J.on(B,"mouseover",function(s){var s=s||window.event;var r=s.target||s.srcElement;var q=J.getPosition(r);var p=s.relatedTarget||s.fromElement;var o=J.getMousePos(s);var m=o.x-q.l;var t=o.y-q.t;r.buttontype=1;r.x=m;r.y=t;if(J.contains(B,p)){return }B.time=+new Date})}var j=this,E=_bdS,n=J.getSize(),l=V.getElementById(this.conf.bdIdsl),T=V.getElementById("bdsIfr"),W=(!K&&!g)?"fixed":"absolute",i=(K?n.t:0)+(this.conf.bdTop==0?(n.h<l.offsetHeight?-40:(n.h/2-l.offsetHeight/2)):parseInt(this.conf.bdTop));J.setAttr(E,"overflow:hidden;height:330px;position:"+W+";top:"+i+"px;"+this.conf.bdLeft+":0;"+((k=="right")?k+":"+(n.w-this.imgW)+"px":""));J.setAttr(l,k+":"+this.imgW+"px;display:none");a.bind(E,"click","img",function(){Q(3072);d.create()});a.bind(E,"mouseover","img",U);a.bind(l,"mouseover","a");function U(){J.setAttr(l,"display:block;");if((l.offsetWidth+j.imgW)==E.offsetWidth){return }tm=setTimeout(function(){if((l.offsetWidth+j.imgW)!=E.offsetWidth){j._move(E,0,j.imgW,l.offsetWidth,T)}},100);j._popShow(l,{over:function(){J.setAttr(T,"height:"+l.offsetHeight+"px;"+j.conf.bdLeft+":0;top:0;display:block")},out:function(){}});j._popShow(E,{over:function(){},out:function(){if(E.offsetWidth==(l.offsetWidth+j.imgW)){clearTimeout(tm);j._move(E,0,l.offsetWidth+j.imgW,-l.offsetWidth,T)}T.style.display="none"}})}J.scroll(E,"slide");J.on(F,"resize",function(){J.setAttr(E,((k=="right")?k+":"+(J.getSize().w-j.imgW)+"px":""))})},_move:function(B,j,e,T,D){var i=B.style,W=D.style,U=this,E=6;setInterval(function(){if(j<E){j++;i.width=Math.ceil(T*j/E+e)+"px";W.width=Math.ceil(T*j/E+e)-U.imgW+"px"}else{return }},10)},_popShow:function(T,B){if(V.all){T.onmouseenter=function(U){E(F.event)};T.onmouseleave=D}else{T.onmouseover=function(U){U.relatedTarget==null?E(U):(!(this===U.relatedTarget||this.compareDocumentPosition(U.relatedTarget)==20)&&E(U))};T.onmouseout=function(U){U.relatedTarget==null?D(U):(!(this===U.relatedTarget||this.compareDocumentPosition(U.relatedTarget)==20)&&D(U))}}function E(U){B.over(U)}function D(U){B.out(U)}}}})();M();bdShare.fn.init()})();
(2)logger.js
var bdShare=bdShare||{};bdShare._LogPool=bdShare._LogPool||[],bdShare.ApiPVLogger||function(e){function u(e,t){var n=[];for(var r in t){var i=typeof t[r];i!="function"&&i!="object"&&t.hasOwnProperty(r)&&n.push(e+"_"+r+"="+t[r])}return n.join("&")}function a(){var e=bdShare._LogPool||[],t={};for(var n=e.length-1;n>=0;n--){var r=e[n],i=t[r.key];i?(i.linkid=i.linkid||r.api.linkid,i.type=(i.type||0)|(r.api.type||0)):t[r.key]=r.api}e=[];for(var s in t)t.hasOwnProperty(s)&&e.push({key:s,api:t[s]});return bdShare._LogPool=e,e}function f(){var e=bdShare._LogPool||[],t=e.length;if(t>0){e=a(),t=e.length;var n=[],i="",s=null,f=[0,0,0,0,0,0,0,0];for(var l=0;l<t;l++)s=e[l],f[r[s.key]]=1,s.api.linkid&&(i=s.api.linkid,delete s.api.linkid),n.push(u(s.key,s.api));n.unshift("linkid="+i),n.unshift("apitype="+parseInt(f.reverse().join(""),2)),o(n.join("&"))}}function c(){l=!0,t.dom.ready(function(){setTimeout(function(){p(),h()},1e3)})}var t,n=t=n||{version:"1.5.2.2"};n.guid="$BAIDU$",n.$$=window[n.guid]=window[n.guid]||{global:{}},n.ajax=n.ajax||{},n.fn=n.fn||{},n.fn.blank=function(){},n.ajax.request=function(e,t){function v(){if(d.readyState==4){try{var e=d.status}catch(t){g("failure");return}g(e),e>=200&&e<300||e==304||e==1223?g("success"):g("failure"),window.setTimeout(function(){d.onreadystatechange=n.fn.blank,s&&(d=null)},0)}}function m(){if(window.ActiveXObject)try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}if(window.XMLHttpRequest)return new XMLHttpRequest}function g(e){e="on"+e;var t=c[e],r=n.ajax[e];if(t){h&&clearTimeout(h);if(e!="onsuccess")t(d);else{try{d.responseText}catch(i){return t(d)}t(d,d.responseText)}}else if(r){if(e=="onsuccess")return;r(d)}}var r=t||{},i=r.data||"",s=r.async!==!1,o=r.username||"",u=r.password||"",a=(r.method||"GET").toUpperCase(),f=r.headers||{},l=r.timeout||0,c={},h,p,d;for(p in r)c[p]=r[p];f["X-Requested-With"]="XMLHttpRequest";try{d=m(),a=="GET"&&(i&&(e+=(e.indexOf("?")>=0?"&":"?")+i,i=null),r.noCache&&(e+=(e.indexOf("?")>=0?"&":"?")+"b"+ +(new Date)+"=1")),o?d.open(a,e,s,o,u):d.open(a,e,s),s&&(d.onreadystatechange=v),a=="POST"&&d.setRequestHeader("Content-Type",f["Content-Type"]||"application/x-www-form-urlencoded");for(p in f)f.hasOwnProperty(p)&&d.setRequestHeader(p,f[p]);g("beforerequest"),l&&(h=setTimeout(function(){d.onreadystatechange=n.fn.blank,d.abort(),g("timeout")},l)),d.send(i),s||v()}catch(y){g("failure")}return d},n.browser=n.browser||{},function(){var e=navigator.userAgent;n.browser.safari=/(\d+\.\d)?(?:\.\d)?\s+safari\/?(\d+\.\d+)?/i.test(e)&&!/chrome/i.test(e)?+(RegExp.$1||RegExp.$2):undefined}(),n.browser.ie=n.ie=/msie (\d+\.\d+)/i.test(navigator.userAgent)?document.documentMode||+RegExp.$1:undefined,n.browser.opera=/opera(\/| )(\d+(\.\d+)?)(.+?(version\/(\d+(\.\d+)?)))?/i.test(navigator.userAgent)?+(RegExp.$6||RegExp.$2):undefined,n.dom=n.dom||{},function(){var e=n.dom.ready=function(){function r(){if(!r.isReady){r.isReady=!0;for(var e=0,n=t.length;e<n;e++)t[e]()}}function i(){try{document.documentElement.doScroll("left")}catch(e){setTimeout(i,1);return}r()}function s(){if(e)return;e=!0;if(document.readyState==="complete")r.isReady=!0;else if(document.addEventListener)document.addEventListener("DOMContentLoaded",n,!1),window.addEventListener("load",r,!1);else if(document.attachEvent){document.attachEvent("onreadystatechange",n),window.attachEvent("onload",r);var t=!1;try{t=window.frameElement==null}catch(s){}document.documentElement.doScroll&&t&&i()}}var e=!1,t=[],n;return document.addEventListener?n=function(){document.removeEventListener("DOMContentLoaded",n,!1),r()}:document.attachEvent&&(n=function(){document.readyState==="complete"&&(document.detachEvent("onreadystatechange",n),r())}),s(),function(e){r.isReady?e():t.push(e)}}();e.isReady=!1}(),t.undope=!0;var r={cite:0,img:1,addto:2,video:3},i=window.location||document.location,s=function(){var e=[];return function(t){var n="bdsharelog__"+(new Date).getTime(),r=e[n]=new Image;r.onload=r.onerror=function(){e[n]=null},r.src=t,r=null}}(),o=function(e){var t=document.body.offsetWidth,n=document.body.offsetHeight,r=window.screen.availWidth,i=window.screen.availHeight,o=[t,n,r,i].join(","),u="http://nsclick.baidu.com/v.gif?pid=307&type=3071&sc="+o+"&desturl="+encodeURIComponent(document.referrer)+"&";s(u+e)},l=!1,h=function(){var e=+(new Date),n={spendTime:0,scrollTop:0,viewHeight:0},r=+(new Date),i=function(){var e=new Date-r;if(e>n.spendTime){var t=document.compatMode=="BackCompat"?document.body:document.documentElement;n={spendTime:e,scrollTop:window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop,viewHeight:t.clientHeight}}r=new Date},o=function(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent&&e.attachEvent("on"+t,n)},u=0,a=1e3;setInterval(function(){document.hasFocus()&&u++},a),o(window,"scroll",i),o(window,"beforeunload",function(){var r=new Date-e;if(r==0)return;i();var o=["http://nsclick.baidu.com/v.gif?pid=307","type=3075","l="+r,"t="+n.scrollTop,"s="+n.spendTime,"v="+n.viewHeight,"f="+u*a,"r="+encodeURIComponent(document.referrer),"u="+encodeURIComponent(window.location.href)].join("&");/firefox\/(\d+\.\d+)/i.test(navigator.userAgent)?t.ajax.request(o,{async:!1,timeout:300}):s(o)})},p=function(){var e=0;return function(){if(bdShare.velocity&&(!bdShare.velocity.mainJsLoaded||!bdShare.velocity.cssLoadEnd)&&e++<3)setTimeout(p,1e3);else{if(bdShare.velocity){var t=Math.max(bdShare.velocity.cssLoadEnd,bdShare.velocity.mainJsLoaded)-bdShare.velocity.start||0,n=bdShare.velocity.cssLoadEnd-bdShare.velocity.cssLoadStart||0,r=bdShare.velocity.mainJsLoaded-bdShare.velocity.start||0;bdShare._LogPool.length>0&&bdShare._LogPool.push({key:"velo",api:{load:t,cssload:n,jsLoad:r}})}f()}}}();e.ApiPVLogger={add:function(e,t){bdShare._LogPool.push({key:e,api:t})}},l||c()}(bdShare);
注意:
由于博客字数限制,本篇文章只展示了部分代码
本项目的完整源码及素材关注+私信我获取
最后祝大家平安夜快乐