fix: typed warning

This commit is contained in:
shenyu 2020-06-28 21:59:40 +08:00
parent eb98909f8b
commit 141208f47e
2 changed files with 19 additions and 18 deletions

View File

@ -1,22 +1,5 @@
<%- js('/js/jquery-2.0.3.min') %> <%- js('/js/jquery-2.0.3.min') %>
<%- js('/js/lazyload.min') %> <%- js('/js/lazyload.min') %>
<!-- Subtitle -->
<% if (theme.subtitle.enable){ %>
<script>
try {
var typed = new Typed("#subtitle", {
strings: ['<%= theme.subtitle.text %>', '<%= theme.subtitle.text2 %>', '<%= theme.subtitle.text3 %>'],
startDelay: <%= theme.subtitle.startDelay %>,
typeSpeed: <%= theme.subtitle.typeSpeed %>,
loop: <%= theme.subtitle.loop %>,
backSpeed: <%= theme.subtitle.backSpeed %>,
showCursor: <%= theme.subtitle.showCursor %>
});
} catch (err) {
console.log(err)
}
</script>
<% } %>
<!-- Tocbot --> <!-- Tocbot -->
<% if (theme.toc && is_post() && !page.no_toc){ %> <% if (theme.toc && is_post() && !page.no_toc){ %>
<%- js('/js/tocbot.min') %> <%- js('/js/tocbot.min') %>

View File

@ -39,3 +39,21 @@
<% if (theme.subtitle.enable){ %> <% if (theme.subtitle.enable){ %>
<script src="https://cdn.jsdelivr.net/npm/typed.js@2.0.11/lib/typed.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/typed.js@2.0.11/lib/typed.min.js"></script>
<% } %> <% } %>
<!-- Subtitle -->
<% if (theme.subtitle.enable){ %>
<script>
try {
var typed = new Typed("#subtitle", {
strings: ['<%= theme.subtitle.text %>', '<%= theme.subtitle.text2 %>', '<%= theme.subtitle.text3 %>'],
startDelay: <%= theme.subtitle.startDelay %>,
typeSpeed: <%= theme.subtitle.typeSpeed %>,
loop: <%= theme.subtitle.loop %>,
backSpeed: <%= theme.subtitle.backSpeed %>,
showCursor: <%= theme.subtitle.showCursor %>
});
} catch (err) {
console.log(err)
}
</script>
<% } %>