多说加入颜文字
多说颜文字技术来源于香菇:https://github.com/siitakechan/Duoshuo-Kaomoji
本次教程多说css来源于轻梦:https://github.com/chainwon/duoshuo

第一步:将默认引入的多说js改为下文附件中的embed.min.js

ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http://') + '//static.duoshuo.com/embed.js';
改为
ds.src = 'http://域名等/embed.min.js';

第二步:将附件的duoshuo.css里面的css填入多说自定义css中,本地化加载大概也行。

第三步:引入附件中的kaomoji.js文件[注:多说颜文字需要引入jQuery,kaomoji.js需要在jq后面引入]

问题:如果出现排版错乱等问题,尝试切换多说的主题再次尝试。

附件下载:http://pan.baidu.com/s/1miFB0Yc

颜文字表情框点击非表情框的位置消失:在kaomoji.js后面加入下面的代码(只对主评论框有效,回复时无效233)

$(document).click(function (e) {
    var dragel = $(".ywz")[0],
        target = e.target;
    if (dragel !== target && !$.contains(dragel, target)) {
      $('#ymz').prop('class', 'ywz');
$('#biaoqing_box').prop('class', 'biaoqing_box');
    }
});
版权属于:泽泽社长
本文链接:https://blog.zezeshe.com/archives/duoshuo-kaomoji.html
本站未注明转载的文章均为原创,并采用 CC BY-NC-SA 4.0 授权协议,转载请注明来源,谢谢!