微博、微信、qq、空间、等分享功能

微博、微信、qq、空间、等分享功能

  1. 这个jquery.qrcode.min.js是生成二维码的js
<script type="text/javascript" src="jquery/jquery.qrcode.min.js"></script>
<script type="text/javascript">
$(function() {
    var share_title="分享微博、qq、QQ空间等标题";

    //生成分享二维码
    var pathurl=window.location.href;
    $('.share_wechat_img').qrcode({
        render: 'table',
        text: pathurl,
        width: '110',
        height: '110',
        correctLevel: 0 //扫二维码的未定性,多个的话可以用(12,3等)。
    });

    /*分享到微信*/
    $(".btn_share_wechat").hover(function() {
        $(".share_wechat_box").show();
    }, function() {
        $(".share_wechat_box").hide();
    });
    /*分享到QQ*/
    $(".btn_share_qq").on("click",function(){
      var _shareUrl = 'http://connect.qq.com/widget/shareqq/index.html?';
      _shareUrl += 'url=' + encodeURIComponent(pathurl);
      _shareUrl += '&title=' + encodeURIComponent(share_title);
      window.open(_shareUrl);
    });
    /*分享到QQ空间*/
	
    var share_zone_url=pathurl;
    $(".btn_share_zone").on("click",function(){
      var _shareUrl = 'http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?';
      _shareUrl += 'url=' + encodeURIComponent(pathurl);
      _shareUrl += '&title=' + encodeURIComponent(share_title);
      window.open(_shareUrl);
    });
    /*分享到新浪*/
    $(".btn_share_xinlang").on("click",function(){
      var _shareUrl = 'http://v.t.sina.com.cn/share/share.php?';//appkey别人的
      _shareUrl += 'url=' + encodeURIComponent(pathurl);
      _shareUrl += '&title=' + encodeURIComponent(share_title);
      window.open(_shareUrl);
    });
	/*分享到豆瓣*/
	$(".btn_share_douban").on("click",function(){
		var _shareUrl = 'http://shuo.douban.com/!service/share?';
		_shareUrl += 'href=' + encodeURIComponent(pathurl);
		_shareUrl += '&name=' + encodeURIComponent(share_title);
		window.open(_shareUrl);
	});
	/*分享到腾讯微博*/
	$(".btn_share_tengxun").on("click",function(){
		var _shareUrl = 'http://v.t.qq.com/share/share.php?';
		_shareUrl += 'title=' + encodeURIComponent(share_title);
		_shareUrl += '&url=' + encodeURIComponent(pathurl);
		window.open(_shareUrl);
	});
	/*分享到人人网*/
	$(".btn_share_renren").on("click",function(){
		var _shareUrl = 'http://share.renren.com/share/buttonshare.do?';
		_shareUrl += 'link=' + encodeURIComponent(pathurl);
		_shareUrl += '&title=' + encodeURIComponent(share_title);
		window.open(_shareUrl);
	});

});
</script>
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值