如何添加社交网图标到自己网站上?
如何添加社交网图标到自己网站上?
[解决办法]
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<style>
#share a{background-attachment: scroll;background-clip: border-box;background-color: transparent;background-image: url(http://misc.360buyimg.com/201007/skin/df/i/icon_site20110414.gif);background-origin: padding-box;background-repeat: no-repeat;color: #333;cursor: auto;display: block;float: left;font-family: 宋体, Arial, Lucida, Verdana, Helvetica, sans-serif;font-size: 12px;height: 23px;line-height: 100px;list-style-image: none;list-style-position: outside;list-style-type: none;margin-bottom: 0px;margin-left: 0px;margin-right: 0px;margin-top: 0px;overflow-x: hidden;overflow-y: hidden;padding-bottom: 0px;padding-left: 0px;padding-right: 0px;padding-top: 0px;text-align: -webkit-auto;text-decoration: none;width: 22px;}
#site-sina{background-position: -93px -24px;}
#site-qzone{background-position: 0px -24px;}
#site-renren{background-position: -47px -24px;}
#site-kaixing{background-position:-70px -24px;}
#site-douban{background-position: -24px -24px;}
#site-msn{background-position:-139px -24px;}
#site-qq{background-position:-162px -24px;}
</style>
<div id="share">
<a href="javascript:void(0)" onclick="jdPshowRecommend('http://service.weibo.com/share/share.php?','sina');" id="site-sina" title="推荐到新浪微博">sina</a>
<a href="javascript:void(0)" onclick="jdPshowRecommend('http://v.t.qq.com/share/share.php?source=1000002&site=http://www.360buy.com','qzone');" id="site-qzone" title="推荐到腾讯微博">qzone</a>
<a href="javascript:void(0)" onclick="jdPshowRecommend('http://share.renren.com/share/buttonshare/post/1004?','renren');" id="site-renren" title="推荐到人人">renren</a>
<a href="javascript:void(0)" onclick="jdPshowRecommend('http://www.kaixin001.com/repaste/share.php?','kaixing');" id="site-kaixing" title="推荐到开心网">kaixing</a>
<a href="javascript:void(0)" onclick="jdPshowRecommend('http://www.douban.com/recommend/?','douban');" id="site-douban" title="推荐到豆瓣">douban</a>
<a href="javascript:void(0)" onclick="jdPshowRecommend('http://profile.live.com/badge/?','MSN');" id="site-msn" title="推荐到MSN">msn</a>
</div>
<script type="text/javascript">
var sinaurl = "";
function jdPshowRecommend(url,stype) {
var title = "这里是网页标题";
var content = "这里是分享内容";
var img ="这里是分享图片地址";
var pageUrl =location.href;
if (stype == "qzone"){url = url + "&title=" + content + "&pic=" + img + "&url=" + pageUrl;}
if (stype == "renren"){url = url + "title=" + title +"&content="+ content + "&pic=" + img + "&url=" + pageUrl;}
if (stype == "kaixing"){url = url + "rtitle=" + title + "&rcontent=" + content + "&rurl=" + pageUrl;}
if (stype == "douban"){url = url + "title=" + title + "&comment=" + content + "&url=" + pageUrl;}
if (stype == "MSN"){url = url + "url=" + pageUrl + "&title=" + title + "&description=" + content + "&screenshot=" + img;}
if (stype == "sina"){url = url + "url=" + pageUrl + "&title=" + title + "&pic=" + img;}
window.open(encodeURI(url), "", "height=500, width=600");
}
</script>
[解决办法]
直接用 百度分享 就可以啦
百度分享