现在的位置: 首页 > 综合 > 正文

站外分享 源代码

2013年10月01日 ⁄ 综合 ⁄ 共 8632字 ⁄ 字号 评论关闭

<!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>
<title>站外分享</title>
<script type="text/javascript">
function addFavorite(){
    var aUrls=document.URL.split("/");
    var vDomainName="http://"+aUrls[2]+"/";
    var description=document.title;
    try{//IE
        window.external.AddFavorite(vDomainName,description);
    }catch(e){//FF
        window.sidebar.addPanel(description,vDomainName,"");
    }
}
function CopyURL(){
    var myHerf=top.location.href;
    var title=document.title;
    if(window.clipboardData){
        var tempCurLink=title + "/n" + myHerf;
        var ok=window.clipboardData.setData("Text",tempCurLink);
        if(ok) alert("帖子标题和链接已复制,您可以转发给QQ/MSN上的好友了。");
    }
    else{alert("您使用的浏览器不支持复制功能,请使用Ctrl+C或鼠标右键在浏览器地址栏复制帖子链接。");}
}
window.onload=function(){
    clickMenu('share');
}
clickMenu = function(share) {
    var getEls = document.getElementById(share).getElementsByTagName("li");
    var getAgn = getEls;
    for (var i=0; i<getEls.length; i++) {
        getEls[i].onmouseover=function() {
            this.className+="shownav";
        }
        getEls[i].onmouseout=function() {
            this.className=this.className.replace("shownav", "");
        }
    }
}
function show(id){
    if(id = document.getElementById(id)){
        if(id.style.display == "block"){
            id.style.display = "none";
        }else{
            id.style.display = "block";
        }
    }
}

</script>
<style>
* {margin:0;padding:0;}
img {border:none;}
body {color:#333;font-size:12px;font-family:"宋体";background:#f5f9fa;}
ul,ol {list-style:none;}
a {color:#0b59b2;text-decoration:none;}
a:hover {color:#f00;text-decoration:none;}
.clear {clear:both;width:0;height:0;line-height:0;font-size:0;visibility:hidden;}
.function {display:block;clear:both;height:24px;padding:20px 0 10px;overflow:hidden;}
.btmfunc {display:block;clear:both;height:24px;padding:38px 0 20px;overflow:hidden;}
.info {display:block;float:left;height:22px;line-height:22px;padding:0 5px;color:#0b59b2;}
.info span {color:#f00;}
.share {display:block;float:left;width:480px;}
.share ul {display:block;padding:0;margin:0;list-style:none;height:24px;}
.share ul li {display:block;float:left;height:22px;margin-right:3px;border:1px solid #cadbe7;}
.share ul li a {display:block;height:16px;line-height:16px;padding:3px;padding-left:23px;cursor:pointer;background:#fff url(http://static.tianya.cn/img/static/2009/imagesNew/share.gif) no-repeat;}
.share ul li a:hover {background-color:#ecf8fc;}
.share ul li a.addfav {width:62px;background-position:3px 0;}
.share ul li a.transmit {width:62px;background-position:3px -44px;}
.share ul li a.toshare {width:62px;background-position:3px -66px;}
.share ul li a.renren {background-position:3px -88px;}
.share ul li a.kaixin {background-position:3px -154px;}
.share ul li a.douban {background-position:3px -176px;}
.share ul li a.guge {background-position:3px -198px;}
.share ul li a.qq {background-position:3px -220px;}
.share ul li a.baidu {background-position:3px -242px;}
.share ul li a.delicious {background-position:3px -110px;}
.share ul li a.bai {background-position:3px -132px;}
.share ul li a.sinat {background-position:3px -264px;}
.share ul li a.live {background-position:3px -286px;}
.share ul li a.digu {background-position:3px -308px;}
.share ul li a.yahoo {background-position:3px -330px;}
.share ul li a.rline {margin-right:8px;}
.share ul li .webs span a {display:block;width:55px;overflow:hidden;}
.webs {position:absolute;display:none;clear:both;width:170px;padding:3px 3px 3px 5px;margin-left:-1px;border:1px solid #cadbe7;background:#fff url() 88px -347px no-repeat;overflow:hidden;}
.webs span {display:block;float:left;height:22px;font-family:arial;overflow:hidden;}
.shownav .webs {display:block;}
</style>
</head>

<body>
    <div class="btmfunc">
        <div class="share">
            <ul id="share">
                <li><a class="addfav" href="javascript:void(0);" onclick="addFavorite();return false;">加入收藏夹</a></li>
                <li><a class="transmit" href="javascript:void(0);" onclick="CopyURL();return false;">复制给朋友</a></li>
                <li><a class="toshare" href="javascript:void(0);">分享到外站</a>
                    <div class="webs">
                        <span><a class="guge rline" href="javascript:location.href='http://www.google.com/bookmarks/mark?op=add&bkmk='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)" target="_blank">谷歌书签</a></span>
                        <span><a class="digu" href="javascript:(function(){window.open('http://www.diguff.com/diguShare/bookMark_FF.jsp?title='+encodeURIComponent(document.title)+'&url='+encodeURIComponent(location.href),'_blank','width=580,height=310');})()">嘀咕</a></span>
                        <span><a class="qq rline" href="javascript:window.open('http://shuqian.qq.com/post?from=3&title='+encodeURIComponent(document.title)+'&uri='+encodeURIComponent(document.location.href)+'&jumpback=2&noui=1','favit','width=930,height=470,left=50,top=50,toolbar=no,menubar=no,location=no,scrollbars=yes,status=yes,resizable=yes');void(0)">QQ书签</a></span>
                        <span><a class="sinat" href="javascript:void((function(s,d,e,r,l,p,t,z,c){x=document;y=window;if(x.selection){Q=x.selection.createRange().text;}else%20if(y.getSelection){Q=y.getSelection();}else%20if(x.getSelection){Q=x.getSelection();};var%20f='http://v.t.sina.com.cn/share/share.php?',u=z||d.location,p=['url=',e(u)+e('/n')+e(Q),'&title=',e(t||d.title),'&source=',e(r),'&sourceUrl=',e(l),'&content=',c||'gb2312','&pic=',e(p||'')].join('');function%20a(){if(!window.open([f,p].join(''),'mb',['toolbar=0,status=0,resizable=1,width=440,height=430,left=',(s.width-440)/2,',top=',(s.height-430)/2].join('')))u.href=[f,p].join('');};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else%20a();})(screen,document,encodeURIComponent,'','','','','','utf-8'));">新浪微博</a></span>
                        <span><a class="baidu rline" href="javascript:u=location.href;t=document.title;c%20=%20""%20+%20(window.getSelection%20? window.getSelection() : document.getSelection ? document.getSelection() : document.selection.createRange().text);var url="http://cang.baidu.com/do/add?it="+encodeURIComponent(t)+"&iu="+encodeURIComponent(u)+"&dc="+encodeURIComponent(c)+"&fr=ien#nw=1";window.open(url,"_blank","scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes"); void 0">百度搜藏</a></span>           
                        <span><a class="kaixin" href="javascript:d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(kaixin=window.open('http://www.kaixin001.com/~repaste/repaste.php?&rurl='+escape(d.location.href)+'&rtitle='+escape(d.title)+'&rcontent='+escape(d.title),'kaixin'));kaixin.focus();">开心网</a></span>
                        <span><a class="yahoo rline" href="#" onclick="window.open('http://myweb.cn.yahoo.com/popadd.html?url='+encodeURIComponent(document.location.href)+'&title='+encodeURIComponent(document.title), 'Yahoo','scrollbars=yes,width=780,height=455,left=80,top=80,status=yes,resizable=yes');return false;">雅虎收藏</a></span>
                        <span><a class="renren" href="javascript:void((function(s,d,e){if(/xiaonei/.com/.test(d.location))return;var%20f='http://share.xiaonei.com/share/buttonshare.do?link=',u=d.location,l=d.title,p=[e(u),'&title=',e(l)].join('');function%20a(){if(!window.open([f,p].join(''),'xnshare',['toolbar=0,status=0,resizable=1,width=626,height=436,left=',(s.width-626)/2,',top=',(s.height-436)/2].join('')))u.href=[f,p].join('');};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else%20a();})(screen,document,encodeURIComponent));">人人网</a></span>
                        <span><a class="delicious rline" href="http://delicious.com/save" onclick="window.open('http://delicious.com/save?v=5&noui&jump=close&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title), 'delicious','toolbar=no,width=550,height=550'); return false;">Delicious</a></span>
                        <span><a class="bai" href="javascript:location.href='http://bai.sohu.com/app/share/blank/add.do?link='+location.href">白社会</a></span>
                        <span><a class="live rline" href="javascript:d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(blog=window.open('https://favorites.live.com/quickadd.aspx?url='+escape(d.title)+'&newspath='+escape(d.location.href)+'&subtitle='+escape(t),'Live'));blog.focus();">MSN空间</a></span>
                        <span><a class="douban" href="javascript:var u='http://www.douban.com/recommend/?url='+location.href+'&title='+encodeURIComponent(document.title);window.open(u,'douban','toolbar=0,resizable=1,scrollbars=yes,status=1,width=450,height=330');void(0)">豆瓣</a></span>
                        <div class="clear"></div>
                    </div>
                </li>
            </ul>
        </div>   
    </div>
</body>
</html>

抱歉!评论已关闭.