JavaScript分享新浪微博、QQ空间、腾讯微博

一、先看效果图:

如图:是分享新浪微博的页面。

二、分享新浪微博、QQ空间、腾讯微博的JavaScript代码

<script type="text/javascript">
	function sharexinlang(title,url,picurl){
		  var sharesinastring='http://v.t.sina.com.cn/share/share.php?title='+title+'&url='+url+'&content=utf-8&sourceUrl='+url+'&pic='+picurl; 
 		 window.open(sharesinastring,'newwindow','height=100,width=100,top=100,left=100');
	}
	function shareqqkongjian(title,url,picurl){
		var shareqqzonestring='http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?summary='+title+'&url='+url+'&pics='+picurl;  
 		window.open(shareqqzonestring,'newwindow','height=400,width=400,top=100,left=100');
	}
	function weixinShareTimeline(content,link,imgUrl){
		var shareqqstring='http://v.t.qq.com/share/share.php?title='+content+'&url='+link+'&pic='+imgUrl;  
 		window.open(shareqqstring,'newwindow','height=100,width=100,top=100,left=100');  
	}
</script>

三、调用方式

<div>
	<div style="display: inline-block;float: right;margin-right: 35px;">
		<a href="javascript:sharexinlang('${video.introduce}','<%=baseURL %>/playVideo.do?videoId=${video.videoId }','<%=baseURL %>/file/${video.imgPath }')"><img src="<%=baseURL %>/images/xinlang.png"/></a>
	</div>
	<div style="display: inline-block;float: right;">
		<a href="javascript:shareqqkongjian('${video.introduce}','<%=baseURL %>/playVideo.do?videoId=${video.videoId }','<%=baseURL %>/file/${video.imgPath }')"><img src="<%=baseURL %>/images/kongjian.png"/></a>
	</div>
	<div style="display: inline-block;float: right;">
		<a href="javascript:weixinShareTimeline('${video.introduce}','<%=baseURL %>/playVideo.do?videoId=${video.videoId }','<%=baseURL %>/file/${video.imgPath }')">
			<img src="<%=baseURL %>/images/weibo.png"></img>
		</a>
	</div>
	<div style="display: inline-block;float: right;">
		<font class="title clearfix yh f16">分享本视频:    </font>
	</div>
	<div style="display: inline-block;float: right;">
		<font class="title clearfix yh f16">
			<a href="<%=baseURL%>/web/add_discuss.jsp?videoId=${video.videoId}&videoName=${video.videoName }"> 我要评论  </a>
		</font>
	</div>
</div>

四、调用完成,点击对应的分享跳出分享页面。

1、新浪微博


2、QQ空间


3、腾讯微博


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值