Closed
Description
Nice doc tool !!
I'm trying to make my site to support multiple theme support, like this:
So I add script to _nvbar.md
, but the script seems not work!
Any one knows how to handle it? Thanks very much
I Add the code below to _navbar.md
, but the script seems can not execute!!
<div class="demo-theme-preview">
<a data-theme="vue">vue.css</a>
<a data-theme="dark">dark.css</a>
</div>
<style>
.demo-theme-preview a {
padding-right: 10px;
}
.demo-theme-preview a:hover {
text-decoration: underline;
cursor: pointer;
}
</style>
<script>
var preview = Docsify.dom.find('.demo-theme-preview');
var themes = Docsify.dom.findAll('[rel="stylesheet"]');
preview.onclick = function (e) {
var title = e.target.getAttribute('data-theme')
themes.forEach(function (theme) {
if(theme.tilte != '' && title != null && title != ''){
theme.disabled = theme.title != title
}
});
};
</script>