多说加入颜文字教程
作者:佚名 来源:爱好者 时间:2016-08-11
多说颜文字技术来源于香菇: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');
}
});
- 上一篇:javascript常用代码记录
- 下一篇:分享一个输入框的打字特效