<script type="text/javascript">
//记忆碎片分享 http://huilang.me
jQuery(document).ready(function(){
var miniBlogShare = function() {
$('<img id="imgSinaShare" class="img_share" title="将选中内容分享到新浪微博" src="/https://huilang.me/wp-content/uploads/2013/08/095419PQv.gif" /><img id="imgQqShare" class="img_share" title="将选中内容分享到腾讯微博" src="/https://huilang.me/wp-content/uploads/2013/08/095419NWF.gif" />').appendTo('body');
$('.img_share').css({
display : 'none',
position : 'absolute',
cursor : 'pointer'
}); var funGetSelectTxt = function() {
var txt = '';
if(document.selection) { txt = document.selection.createRange().text;
} else { txt = document.getSelection(); }
return txt.toString();};
$('html,body').mouseup(function(e) {
if (e.target.id == 'imgSinaShare' || e.target.id == 'imgQqShare') {
return }
e = e || window.event;
var txt = funGetSelectTxt(),
sh = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0,
lef
新浪腾讯微博转发 js代码
最新推荐文章于 2024-03-18 10:19:34 发布
这篇博客介绍了一个使用JavaScript实现的网页内容分享到新浪微博和腾讯微博的功能。通过监听鼠标点击事件,获取用户选中的文本,然后打开新窗口跳转到对应的微博分享页面,自动填充分享内容和来源。


250

被折叠的 条评论
为什么被折叠?



