<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jquery 分享代码在线制作鼠标一键复制url路径功能与分享信息</title>
</head>
<body>
<style type="text/css">
*{margin:0;padding:0;list-style-type:none;}
a,img{border:0;}
a{color:#333;text-decoration:none;}
a:hover{color:#3366cc;text-decoration:underline;}
body{font:12px/180% Arial, Helvetica, sans-serif,"宋体";}
/* share-con */
.share-con{height:38px;overflow:hidden;padding-left:10px;}
.share-con span.tit{float:left;line-height:38px;}
.share-con a,.share-con a span{height:16px;width:16px;display:block;float:left;overflow:hidden;}
.share-con a{padding:3px;border:solid 1px #fff;margin-top:7px;}
.share-con a span{background-image:url(images/share-icon.gif);background-repeat:no-repeat;cursor:pointer;}
.share-con a:hover{opacity:0.7;filter:alpha(opacity=70);border:solid 1px #ddd;}
.share-con a span.copylink{background-position:0 0;}
.share-con a span.tengxunweibo{background-position:0 -16px;}
.share-con a span.xinlang{background-position:0 -32px;}
.share-con a span.sohu{background-position:0 -48px;}
.share-con a span.wangyi{background-position:0 -64px;}
.share-con a span.qqzone{background-position:0 -80px;}
.share-con a span.qqpengyou{background-position:0 -96px;}
.share-con a span.renren{background-position:0 -112px;}
.share-con a span.kaixin{background-position:0 -128px;}
.share-con a span.taojianghu{background-position:0 -144px;}
.share-con a span.douban{background-position:0 -160px;}
.share-con a span.baidusoucang{background-position:0 -176px;margin-right:0px;}
</style>
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
function copyLink(){
try {
var cText = document.location.toString();
if (window.clipboardData) {
window.clipboardData.setData("Text", cText);
alert("页面链接复制成功,你可以粘贴到飞信、QQ或MSN发送给好友");
} else if (window.netscape) {
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
} catch (e) {
alert("您的浏览器设置为不允许复制!\n如果需要此操作,请在浏览器地址栏输入'about:config'并回车\n然后将'signed.applets.codebase_principal_support'设置为'true',再重试复制操作!");
return false;
}
var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
if (!clip)
return;
var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
if (!trans) {
return;
}
trans.addDataFlavor('text/unicode');
var str = new Object();
var len = new Object();
var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
str.data = cText;
trans.setTransferData("text/unicode", str, cText.length * 2);
var clipid = Components.interfaces.nsIClipboard;
if (!clip)
return false;
clip.setData(trans, null, clipid.kGlobalClipboard);
alert("页面链接复制成功,你可以粘贴到飞信、QQ或MSN发送给好友");
}
} catch (e) {
}
};
// 分享代码
var shareid = "fenxiang";
(function() {
var a = {
url:function() {
return encodeURIComponent(window.location.href)
},title:function() {
return encodeURIComponent(window.document.title)
},content:function(b) {
if (b) {
return encodeURIComponent($("#" + b).html())
} else {
return""
}
},setid:function() {
if (typeof(shareid) == "undefined") {
return null
} else {
return shareid
}
},kaixin:function() {
window.open("http://www.kaixin001.com/repaste/share.php?rtitle=" + this.title() + "&rurl=" + this.url() + "&rcontent=" + this.content(this.setid()))
},renren:function() {
window.open("http://share.renren.com/share/buttonshare.do?link=" + this.url() + "&title=" + this.title())
},sinaminiblog:function() {
window.open("http://v.t.sina.com.cn/share/share.php?url=" + this.url() + "&title=" + this.title() + "&content=utf-8&source=&sourceUrl=&pic=")
},baidusoucang:function() {
window.open("http://cang.baidu.com/do/add?it=" + this.title() + "&iu=" + this.url() + "&dc=" + this.content(this.setid()) + "&fr=ien#nw=1")
},taojianghu:function() {
window.open("http://share.jianghu.taobao.com/share/addShare.htm?title=" + this.title() + "&url=" + this.url() + "&content=" + this.content(this.setid()))
},wangyi:function() {
window.open("http://t.163.com/article/user/checkLogin.do?source=%E7%BD%91%E6%98%93%E6%96%B0%E9%97%BB%20%20%20&link=" + this.url() + "&info=" + this.content(this.setid()))
},qqzone:function() {
window.open('http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=' + encodeURIComponent(location.href) + '&title=' + encodeURIComponent(document.title))},pengyou:function() {
window.open('http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?to=pengyou&url=' + encodeURIComponent(location.href) + '&title=' + encodeURIComponent(document.title))
},douban:function() {
window.open("http://www.douban.com/recommend/?url=" + this.url() + "&title=" + this.title() + "&v=1")
}};
window.share = a
})();
$(function() {
$(".renren").click(function() {
share.renren();
});
$(".xinlang").click(function() {
share.sinaminiblog();
});
$(".douban").click(function() {
share.douban();
});
$(".kaixin").click(function() {
share.kaixin();
});
$(".taojianghu").click(function() {
share.taojianghu();
});
$(".wangyi").click(function() {
share.wangyi();
});
$(".qqzone").click(function() {
share.qqzone();
});
$(".baidusoucang").click(function() {
share.baidusoucang();
});
$(".qqweibo").click(function() {
share.qqweibo();
});
$(".qqpengyou").click(function() {
share.pengyou();
});
});
function postToWb() {
var _t = encodeURI(document.title);
var _url = encodeURI(document.location);
var _appkey = encodeURI("appkey");
var _u = 'http://v.t.qq.com/share/share.php?title=' + _t + '&url=' + _url + '&appkey=' + _appkey;
window.open(_u);
}
</script>
<!--百度收藏有用-->
<div id="fenxiang">jquery网页特效提供了jquery 广告 jquery图片特效 jquery文字特效 jquery菜单特效 jquery弹出层特效 jquery幻灯片特效 jquery表单验证特效、jquery 提示框特效等jquery特效。<a href="http://www.jsfoot.com/">http://www.jsfoot.com/</a></div>
<div class="share-con">
<span class="tit">分享有礼:</span>
<a title="复制链接" href="javascript:void(0)" onclick="copyLink()"><span class="copylink"></span></a>
<a title="分享到腾讯微博" href="javascript:void(0)" onclick="postToWb();"><span class="tengxunweibo"></span></a>
<a title="分享到新浪微博" href="javascript:void(0);"><span class="xinlang"></span></a>
<a title="分享到搜狐微博" href="javascript:void((function(s,d,e,r,l,p,t,z,c){var f='http://t.sohu.com/third/post.jsp?',u=z||d.location,p=['&url=',e(u),'&title=',e(t||d.title),'&content=',c||'gb2312','&pic=',e(p||'')].join('');function%20a(){if(!window.open([f,p].join(''),'mb',['toolbar=0,status=0,resizable=1,width=660,height=470,left=',(s.width-660)/2,',top=',(s.height-470)/2].join('')))u.href=[f,p].join('');};if