teler

先下载js包并引用
官网:http://www.calledt.com/soshm/
github:https://github.com/calledT/soshm

//隐藏域 点击分享以后弹出本隐藏域

<div class="soshm" id="share"></div>

js代码

<script>
        //所有支持的分享出去的网站
        // weixin,weixintimeline,qq,qzone,yixin,weibo,tqq,renren,douban,tieba
        var supportUrl=[\'qq\', \'qzone\',\'weibo\',\'yixin\',\'weibo\',\'tqq\',\'renren\',\'douban\',\'tieba\'];//初始化支持的分享网站
        //qq浏览器或者uc浏览器才能调起微信好友和微信朋友圈功能,所以在这加一个判断能调起的功能
        if(navigator.userAgent.indexOf(\'UCBrowser\') > -1||navigator.userAgent.indexOf(\'MQQBrowser\') > -1) {
            //push两个元素进数组
            supportUrl.push(\'weixin\',\'weixintimeline\');
        } 
        soshm(\'#share\', {
              // 分享的链接,默认使用location.href。
              url:\'\',
              // 分享的标题,默认使用document.title
              title: \'\',
              // 分享的摘要,默认使用<meta name="description" content="">content的值
              digest: \'\',
              // 分享的图片,默认获取本页面第一个img元素的src
              pic: \'\',
              // 显示的支持分享的网站
              sites: supportUrl
        });             
        </script>

分类:

技术点:

相关文章: