jquery之qq邮箱分享

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/kevin_love_it/article/details/78641248
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
	<script src="../../document/lib/jquery-3.2.1.min.js"></script>
	<title>jquery event object</title>
	<style>
		
	</style>
</head>
<body>
	<h2>jquery event</h2>
	<div style="width:100%;background-color:#dcdcdc">
		<!-- 给我写信 -->
		<a target="_blank" 
		href="http://mail.qq.com/cgi-bin/qm_share?t=qm_mailme&email=TyQqOSYhECMgOSoQJjsPPj5hLCAi" 
		style="text-decoration:none;">
		<img src="http://rescdn.qqmail.com/zh_CN/htmledition/images/function/qm_open/ico_mailme_01.png"/></a>
		<!-- 邮件分享 -->
		<script type="text/javascript">
			(function(){
				var p = {
					url:location.href,
					to:'qqmail',
					desc:'', /*默认分享理由(可选)*/
					summary:'',/*摘要(可选)*/
					title:'',/*分享标题(可选)*/
					site:'',/*分享来源 如:腾讯网(可选)*/
					pics:'' /*分享图片的路径(可选)*/
				};
				var s = [];
				for(var i in p){
					s.push(i + '=' + encodeURIComponent(p[i]||''));
				}
				document.write(["<a target='_blank' ", 'href="http://mail.qq.com/cgi-bin/qm_share?', s.join("&"), '"', ' style="cursor:pointer;text-decoration:none;outline:none"><img src="http://rescdn.qqmail.com/zh_CN/htmledition/images/function/qm_open/ico_share_01.png"/></a>'].join(""));
			})();
		</script>
	</div>
</body>
</html>

效果图

猜你喜欢

转载自blog.csdn.net/kevin_love_it/article/details/78641248