gpt4 book ai didi

javascript - 编辑标签 explorer.js

转载 作者:太空宇宙 更新时间:2023-11-04 09:34:43 25 4
gpt4 key购买 nike

我想删除显示在 tag-explorer.js 生成的标签左侧的字母.我怎样才能做到这一点?

这是实时网站:https://ewelinawoloszyn.github.io/Research/research_03.html

这是脚本:

// The container to hold the tags.
tagContainer = document.querySelector('.tag-container');
// An array of objects where the `'element'` property is the article element (to
// be hidden), and the `'tags'` attribute is an array of tags on this article.
// Articles do not necessarily have to be the <article> element.
articles = [].slice.call(document.querySelectorAll('article')).map(function (article) {
return {
'element': article,
'tags': [].slice.call(article.querySelectorAll('.tags li')).map(function (tag) {
return tag.textContent;
})
};
});
// Create an array of tag names to be available for filtering.
tagNames = ['Public Finance', 'Access', 'Data','Money','Open Source'];
// Initialise tag-explorer.
tagExplorer(tagContainer, articles, tagNames);

这是所需的输出——我想删除带红叉的字母: Here's the desired output

非常感谢任何建议。

最佳答案

您可以通过更改文件中的某些样式来隐藏这些字母 style.css :

改变这个:

.tag-container .letter-header {
display: inline-block;
padding: 0 1em;
}
.tag-container button {
background-color: #AAA;
color: #fff;
-moz-border-radius: 0 3px 3px 0;
-webkit-border-radius: 0 3px 3px 0;
border-radius: 0 3px 3px 0;
border: 0px;
padding: 1px 6px;
}

对此(更改标记为/* .. */):

.tag-container .letter-header {
display: none; /* <!-- modified */
padding: 0 1em;
}
.tag-container button {
margin: 0 5px; /* <!-- added */
background-color: #AAA;
color: #fff;
-moz-border-radius: 0 3px 3px 0;
-webkit-border-radius: 0 3px 3px 0;
border-radius: 0 3px 3px 0;
border: 0px;
padding: 1px 6px;
}

第一个变化导致字母不被渲染。如果不做进一步的改变,这将使标签(按钮)相互粘在一起。第二个变化解决了这个问题,并在它们之间引入了一个空白空间。

关于javascript - 编辑标签 explorer.js,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40448247/

25 4 0