zoukankan      html  css  js  c++  java
  • 分享至微信、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方式
    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);
    });
  • 相关阅读:
    UPS FAQ-不错的UPS资料
    HPL.dat FAQ
    Fortran77计算某段代码的CPU运行时间
    存储知识 什么是LUN?LUN有什么用?对理解存储设备很有好处
    HPL.dat Tune
    UPS-瓦特(W)和伏安(VA):易混淆的两个概念
    mysql sql 索引相关用法,加快查询速度
    mysql 数据库分类设计方法与PHP结合
    c# SQLServer 数据库连接类
    .net上传图片生成大小缩略图
  • 原文地址:https://www.cnblogs.com/wangqiao170/p/6825261.html
Copyright © 2011-2022 走看看