分享至微信、QQ、微博、复制链接
var share = {
"tit": '您的朋友分享了文章',
"desc": '分享来自百度文库,包含。。。',
"pic": 'https://' + window.location.host + '/web/images/shareLogo.png',
"localhostAdd": 'https://' + window.location.host,
//"pic":'http://www.elitez.cn/c/images/head.jpg',
"url": ''
}
//分享至微信
$('body').on('mouseover', '.wchat', function (event) {
var urlText = $(this).siblings('.urlText').text();
var code = $('.share').text();
//var name = $('#hidden').val();
var questionId = $(this).siblings('.questionId').text();
if ($(this).find(".myQuCode canvas").length == 0) {
$(this).find(".myQuCode").qrcode({
//render: "table", //table方式
width: 110, //宽度
height: 110, //高度
//text: //任意内容
text: window.location.protocol + '//' + window.location.host + "/public/mobile/xinzhiMobile.jsp?questionId=" + questionId
});
}
console.log(window.location.protocol + '//' + window.location.host + "/public/mobile/xinzhiMobile.jsp?questionId=" + questionId)
})
//分享至微博
$('body').on('click', '.share_sina', function (event) {
var urlText = $(this).parent().siblings('.lastLi').find('.urlText').text();
var targetUrl = window.location.protocol + '//' + window.location.host + '/' + urlText;
var code = $('.share').text();
//var name = $('#hidden').val();
var url = "http://v.t.sina.com.cn/share/share.php",
_url = targetUrl,
_title = share.desc,
_appkey = '',
_ralateUid = '',
c = '', pic = share.pic;
c = url + "?url=" + encodeURIComponent(_url) + "&appkey=" + _appkey + "&title=" + _title + "&pic=" + pic + "&ralateUid=" + _ralateUid + "&language=";
window.open(c, "shareQQ", "height=480,width=608,top=100,left=200,toolbar=no,menubar=no,resizable=yes,location=yes,status=no");
});
//分享至QQ
$('body').on('click', '.share_qq', function (event) {
var urlText = $(this).parent().siblings('.lastLi').find('.urlText').text();
var targetUrl = window.location.protocol + '//' + window.location.host + '/' + urlText;
//var name = $('#hidden').val();
var a = "http://connect.qq.com/widget/shareqq/index.html",//"http://connect.qq.com/widget/shareqq/index.html",
d = targetUrl,
m = share.tit,
pic = share.pic,
pl = '加点评论吧...',
titsummary = share.desc,
b = "",
x = window.screen.width,
y = window.screen.height;
h = "", k = ""; //g = l.join("||")||"";
k = a + "?url=" + encodeURIComponent(d) + "&showcount=0&desc=" + encodeURIComponent(pl) + "&summary=" + encodeURIComponent(titsummary) + "&title=" + encodeURIComponent(m) + "&pics=" + pic + "&style=203&width=19&height=22";
window.open(k, "", "height = 680, width = 960, top = " + (y - 680) / 2 + ", left = " + (x - 960) / 2 + ", toolbar = no, menubar = no, resizable = yes, location = yes,status = no");
});
//复制
var clipboard = new Clipboard('.btnShareCopy');
clipboard.on('success', function(e) {
alerter("复制成功")
//console.log(e);
});
分享至微信、QQ、微博、复制链接的更多相关文章
- js分享功能(微信,QQ,微博,空间,豆瓣等)
日常编程中,我们可能会碰到项目中的分享功能,各大平台都有分享接口和文档说明,当然也有一些一键分享插件,例如:sosh,iShare.js等等 但有些同学不想引用插件,那么我整理了一些常用的分享至平台功 ...
- 网页分享到微信、微博、QQ空间、百度贴吧等
1.首先说明的是,pc端微信分享只能通过二维码来分享. 2.下面是js代码. //分享到新浪微博 function shareToSinaWB(event){ event.preventDefault ...
- 分享到微信、微博、QQ空间、QQ微博
一:分享到微信 //分享到微信$("#weixin").bind("click", function () { var p = { url: ...
- 如何在自己的代码中实现分享视频文件或者是图片文件到微信 QQ微博 新浪微博等!!!
首先在文档第一句我先自嘲下 , 我是大傻逼, 弄了两天微信是视频分享,一直被说为啥跟系统的相册分享的不一样,尼玛!!! 这里来说正文,我这里不像多少太多,大家都是程序猿,具体的阔以看代码. 搞代码之前 ...
- javascript社交平台分享-新浪微博、QQ微博、QQ好友、QQ空间、人人网
整理的五个社交平台的分享 <!doctype html> <html lang="en"> <head> <meta charset=&q ...
- unity3d应用内分享(微信、微博等)的实现
问题:如何在unity3d的游戏中实现分享功能,如图 思路: 1.分享功能的实现方式有多种,较方便快捷的一种是直接调用android的API来调出系统的分享界面 2.unity3d里面调用androi ...
- 安卓,通过本地应用分享到微信、facebook等
别的不说了,直接上代码. 支持分享到微信.微博.facebook.twitter package com.example.shareSample; import java.util.List; imp ...
- h5怎么做分享到QQ 、朋友圈、微信 、微博等功能
微信已经成为我们日常聊天联系基本的必备工具,所以小菜我首先介绍一下如何调用微信的分享功能.其实除了可以在微信上分享到朋友圈和发送给好友,微信的分享接口还提供了分享到QQ和分享到腾讯微博等,就是在页面的 ...
- apiCloud 三方分享,微信好友分享,微信朋友圈分享,QQ分享,微博分享
首先查看我的这篇有关三方登录的博客,地址是http://www.cnblogs.com/gqx-html/p/8303567.html,配置完三方数据后可以从上一篇文章中的链接跳转到各个登录查看api ...
随机推荐
- 挂载本地ISO
http://www.linuxidc.com/Linux/2017-03/142087.htm 挂载本地ISO mount -o loop /home/iso/RHEL-server-7.0-x86 ...
- [UE4]IES光源概述文件
IES Light Profiles(IES光源概述文件) 是一条曲线,该曲线在一段弧线中定义了光源强度,虚幻引擎4将会围绕某个轴旋转该弧线,从而使得 点光源 (和从技术上讲的 聚光源,下面会提供更多 ...
- php 数组函数实例
数组的概念 数组(array)是 PHP 中一个非常重要的概念,我们可以把数组看做一系列类似的数据的集合,实际上数组是一个有序图. PHP 还提供了超过 70 个内建函数来操作数组. 由于数组在php ...
- sorted()&enumerate()
d = {1:2,3:1,44:5,4:5,7:8}l = d.items() #转换为列表print(l) # dict_items([(1, 2), (3, 1), (44, 5), (4, 5 ...
- Spark standalone运行模式
Spark Standalone 部署配置 Standalone架构 手工启动一个Spark集群 https://spark.apache.org/docs/latest/spark-standalo ...
- 使用nproxy代理本地服务到内网
前端开发中:很多场景需要在局域网下的其他手机或设备查看网页, 问题来了, web服务部署在本机的某个端口上(8080),只能通过本机浏览器访问, 怎样能让局域网下的其他设备也访问呢?可能你会说 关闭 ...
- __del__,item系列 ,hash方法,__eq__,
# 构造方法 申请一个空间# 析构方法 释放一个空间 # 某个对象借用了操作系统的资源,还要通过析构方法归还回去:文件资源 网络资源 # 垃圾回收机制 class A: def __del__(sel ...
- rhel7配置tiger vnc详解 centos6配置安装vnc-server
参考网站:http://blog.51cto.com/xjsunjie/1963463 结合 https://blog.csdn.net/wamath/article/details/760 ...
- HTML5 Canvas ( 文字横纵对齐 ) textAlign, textBaseLine
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- Flash Builder编译的swf为什么在bin-debug下运行正常,复制到其他文件夹就不正常
在Flash Builder/Flex Builder中,可以使用编译参数-use-network=false实现