bshare插件使用

一、前言

1、要使网页内容得到更多的推广,更加商业化,分享链接无疑是最好的选择

2、bshare 可以简单实现分享到QQ空间、新浪微博、人人网、腾讯微博、网易微博、更多平台等

二、代码

<!DOCTYPE html>
<html>

    <head>
        <meta charset="UTF-8">
        <title>分享到QQ空间、新浪微博、人人网、腾讯微博、网易微博、更多平台</title>
    </head>

    <body>
        <!--就下面这一块代码是重点-->
        <div id="bshare">
            <div class="bshare-custom">
                <a title="分享到QQ空间" class="bshare-qzone"></a>
                <a title="分享到新浪微博" class="bshare-sinaminiblog"></a>
                <a title="分享到人人网" class="bshare-renren"></a>
                <a title="分享到腾讯微博" class="bshare-qqmb"></a>
                <a title="分享到网易微博" class="bshare-neteasemb"></a>
                <a title="更多平台" class="bshare-more bshare-more-icon more-style-addthis"></a><span class="BSHARE_COUNT bshare-share-count">0</span></div>
            <script type="text/javascript" charset="utf-8" src="http://static.bshare.cn/b/buttonLite.js#style=-1&amp;uuid=&amp;pophcol=2&amp;lang=zh"></script>
            <script type="text/javascript" charset="utf-8" src="http://static.bshare.cn/b/bshareC0.js"></script>
        </div>
    </body>

</html>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24

三、功能

1、初步样式 
这里写图片描述 
2、以点击第一个,分享到qq空间为例,即弹出如下小窗口,分享是不是很便捷?

这里写图片描述

3、还有其他分享,点击第六个,弹出如下小窗口,是不是有很多分享选择?

这里写图片描述

四、小结

1、很多高大上的网页,都是通过一些些小功能实现的,如本文的分享功能,还有之前的 天气预报 功能,点击进入

等等,以后有空再补充。一个优秀网站要从细节入手。

<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title>天气预报</title> </head> <body> <!--就这一句代码--> <iframe width="420" scrolling="no" height="600" frameborder="0" allowtransparency="true" src="http://i.tianqi.com/index.php?c=code&id=12&icon=1&num=5"></iframe> </body></html>

2、bshare官方网站

五、其他(2018.4.6更新)

 bshare 第二形态
  • 1
  • 2
①代码
<!DOCTYPE html>
<html>

    <head>
        <meta charset="UTF-8">
        <title>ITAEM团队</title>
    </head>
    <body>
    </body>
    <script>
        window._bd_share_config = {
            "common": {
                "bdSnsKey": {},
                "bdText": "",
                "bdMini": "2",
                "bdMiniList": false,
                "bdPic": "",
                "bdStyle": "0",
                "bdSize": "16"
            },
            "slide": {
                "type": "slide",
                "bdImg": "5",
                "bdPos": "right",
                "bdTop": "100"
            },
            "image": {
                "viewList": ["qzone", "tsina", "tqq", "renren", "weixin"],
                "viewText": "分享到:",
                "viewSize": "16"
            },
            "selectShare": {
                "bdContainerClass": null,
                "bdSelectMiniList": ["qzone", "tsina", "tqq", "renren", "weixin"]
            }
        };
        with(document) 0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5)];
    </script>
</html>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
②效果
点击后的效果同上
  • 1
  • 2

这里写图片描述

六、一键加QQ群(2018.6.3更新)

1、先前往官网:https://qun.qq.com/join.html 
①选择要加入的qq群 
②复制代码 
这里写图片描述
2、代码效果 
① 添加代码到网页中

<!DOCTYPE html>
<html>

    <head>
        <meta charset="UTF-8">
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="format-detection" content="telephone=no">
        <title>ITAEM</title>
        <link rel="stylesheet" href="layui/css/layui.css" />
    </head>

    <body>
        <center>
            <!--使用生成的代码-->
            <a target="_blank" href="//shang.qq.com/wpa/qunwpa?idkey=1c64e972102322c76b18b32b82e6629191a5bac29a54892757edd387d3a3b826"><img border="0" src="//pub.idqqimg.com/wpa/images/group.png" alt="ITAEM团队2018招新群" title="ITAEM团队2018招新群"></a>
        </center>
    </body>

</html>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23

② 可以看到的效果 
这里写图片描述 
③ 点击加qq群 
这里写图片描述 
④ 选择qq号去申请入群

原博地址: https://blog.csdn.net/larger5/article/details/79517112
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值