29 Star 18 Fork 235

openGauss/blog

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
blog.js 1.41 KB
一键复制 编辑 原始数据 按行查看 历史
xzx 提交于 2020-12-23 22:49 +08:00 . !99new style version of blog
$(function () {
var lang = $('html').attr('lang') === 'zh-cn' ? '/zh/' : '/en/';
var query = new AV.Query('Counter');
query.startsWith('url', lang);
query.descending('time');
query.limit(5);
query.find().then(function (data){
var cloneDom = null;
data.forEach(function (item) {
cloneDom = $('.clone-dom').clone().removeClass('hide').removeClass('clone-dom');
cloneDom.find('a').attr('href', item.attributes.url).text(item.attributes.title);
cloneDom.find('.name').text(item.attributes.author);
cloneDom.find('.count').text(item.attributes.time);
$('.top-content').append(cloneDom);
});
})
$(".mask").on('touchmove',function(e){
e.preventDefault(); //阻止默认行为
})
$('.h5-tag .h5-tag-header .filter').click(function () {
if($(this).hasClass('gray')){
return;
}
$(this).toggleClass('blue');
$('.mask').toggleClass('hide');
$('.h5-tag-content').toggleClass('hide');
if($(this).hasClass('blue')){
scrollTo(0, 342);
parent.postMessage(NaN,iUrl);
$(this).find('img').attr('src', '/img/icon-tag-blue.svg');
}else{
$(this).find('img').attr('src', '/img/icon-tag.svg');
}
});
$('.mask').click(function () {
$('.h5-tag .h5-tag-header .filter').trigger('click');
})
})
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/opengauss/blog.git
git@gitee.com:opengauss/blog.git
opengauss
blog
blog
0a1f7baaf4d62ea16788f349f721d8d3e470ac41

搜索帮助