1
0
mirror of https://github.com/ruanyf/es6tutorial.git synced 2025-05-24 18:32:22 +00:00

refact: edit banner

This commit is contained in:
ruanyf 2019-10-15 18:45:13 +08:00
parent 4ebdc52dfb
commit 247a499d6e

View File

@ -95,7 +95,7 @@ function init_sidebar_section() {
} }
location.hash = menu[i + 1]; location.hash = menu[i + 1];
}); });
create_banner($(ditto.sidebar_id).find('p:nth-child(3)').first()); // create_banner($(ditto.sidebar_id).find('p:nth-child(3)').first());
}, "text").fail(function() { }, "text").fail(function() {
alert("Opps! can't find the sidebar file to display!"); alert("Opps! can't find the sidebar file to display!");
@ -219,12 +219,13 @@ function create_banner(element) {
'padding: 1em', 'padding: 1em',
'background-color: #c4e0e1', 'background-color: #c4e0e1',
'border-radius: 5px', 'border-radius: 5px',
'font-size: 75%', 'font-size: 90%',
'width: 210px', // 'font-size: 75%',
// 'width: 210px',
'color: #333333' 'color: #333333'
].join(';'); ].join(';');
var text = '<span style="color: #4682BE;">ES6 实战教程</span> ' + var text = '<span style="color: #4682BE;">ES6 实战教程</span> ' +
'深入学习一线大厂必备 ES6 技能。VIP 教程限时免费领取。' + '深入学习一线大厂必备 ES6 技能。VIP 教程限时免费领取。' +
'<span style="color: #4682BE;"> ⇐ 立即查看</span>'; '<span style="color: #4682BE;"> ⇐ 立即查看</span>';
@ -269,7 +270,7 @@ function create_page_anchors() {
.addClass('content-toc') .addClass('content-toc')
.attr('id', 'content-toc'); .attr('id', 'content-toc');
// create_banner(ul_tag); create_banner(ul_tag);
for (var j = 0; j < headers.length; j++) { for (var j = 0; j < headers.length; j++) {
var li_tag = $('<li></li>').html('<a href="#' + location.hash.split('#')[1] + '#' + headers[j] + '">' + headers[j] + '</a>'); var li_tag = $('<li></li>').html('<a href="#' + location.hash.split('#')[1] + '#' + headers[j] + '">' + headers[j] + '</a>');