2020国产成人精品视频,性做久久久久久久久,亚洲国产成人久久综合一区,亚洲影院天堂中文av色

分享

選中后分享到微博的js代碼

 四兩哥 2012-08-28
<!-- 選中后分享到微博 -->
<style>
.img_sina_share{display:none; position:absolute; cursor:pointer;}
.img_qq_share{display:none; position:absolute; cursor:pointer;}
</style>

<img id="imgSinaShare" class="img_sina_share" title="將選中內(nèi)容分享到新浪微博" src="http://www./sj/images/share.gif" />
<img id="imgQqShare" class="img_qq_share" title="將選中內(nèi)容分享到騰訊微博" src="http://www./sj/images/weiboicon32.png" width="26" height="26" />

<script>
var eleImgShare = document.getElementById("imgSinaShare");
var eleImgShare2 = document.getElementById("imgQqShare");
var artMain = document.getElementById("artMain");

var $miniBlogShare = function(eleShare,eleShare2,eleContainer) {
    var eleTitle = document.getElementsByTagName("title")[0];
    eleContainer = eleContainer || document;
    var funGetSelectTxt = function() {
        var txt = "";
        if(document.selection) {
            txt = document.selection.createRange().text;    // IE
        } else {
            txt = document.getSelection();
        }
        return txt.toString();
    };
    eleContainer.onmouseup = function(e) {
        e = e || window.event;
        var txt = funGetSelectTxt(), sh = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
        var left = (e.clientX - 40 < 0) ? e.clientX + 20 : e.clientX - 40, top = (e.clientY - 40 < 0) ? e.clientY + sh + 20 : e.clientY + sh - 40;
        if (txt) {
            eleShare.style.display = "inline";
            eleShare.style.left = left + "px";
            eleShare.style.top = top + "px";
            eleShare2.style.display = "inline";
            eleShare2.style.left = left + 30 + "px";
            eleShare2.style.top = top + "px";
        } else {
            eleShare.style.display = "none";
            eleShare2.style.display = "none";
        }
    };
    eleShare.onclick = function() {
        var txt = funGetSelectTxt(), title = (eleTitle && eleTitle.innerHTML)? eleTitle.innerHTML : "未命名頁面";
        if (txt) {
            window.open('http://v.t.sina.com.cn/share/share.php?title=' + txt + '&url=' + window.location.href);    
        }
    };
    eleShare2.onclick = function() {
        var txt = funGetSelectTxt(), title = (eleTitle && eleTitle.innerHTML)? eleTitle.innerHTML : "未命名頁面";
        if (txt) {
            window.open( 'http://v.t.qq.com/share/share.php?title=' + txt + '&url=' + window.location.href);    
        }
    };
}(eleImgShare,eleImgShare2,artMain);

</script>
<!-- 選中后分享到微博 end -->

    本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊一鍵舉報。
    轉(zhuǎn)藏 分享 獻花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多