1 Star 0 Fork 235

angryart/blog

forked from openGauss/blog 
Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
blog.js 1.41 KB
Copy Edit Raw Blame History
xzx authored 2020-12-23 22:49 +08:00 . !99 new 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/angryart/blog.git
git@gitee.com:angryart/blog.git
angryart
blog
blog
90a5ddebb7ff7a858bfba4187ee28b3dcf253946

Search