mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2025-05-24 10:22:23 +00:00
refact: edit banner
This commit is contained in:
parent
4ebdc52dfb
commit
247a499d6e
13
js/ditto.js
13
js/ditto.js
@ -95,7 +95,7 @@ function init_sidebar_section() {
|
||||
}
|
||||
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() {
|
||||
alert("Opps! can't find the sidebar file to display!");
|
||||
@ -219,14 +219,15 @@ function create_banner(element) {
|
||||
'padding: 1em',
|
||||
'background-color: #c4e0e1',
|
||||
'border-radius: 5px',
|
||||
'font-size: 75%',
|
||||
'width: 210px',
|
||||
'font-size: 90%',
|
||||
// 'font-size: 75%',
|
||||
// 'width: 210px',
|
||||
'color: #333333'
|
||||
].join(';');
|
||||
|
||||
var text = '<span style="color: #4682BE;">ES6 实战教程</span> ' +
|
||||
var text = '<span style="color: #4682BE;">《ES6 实战教程》</span> ' +
|
||||
'深入学习一线大厂必备 ES6 技能。VIP 教程限时免费领取。' +
|
||||
'<span style="color: #4682BE;">⇐ 立即查看</span>';
|
||||
'<span style="color: #4682BE;"> ⇐ 立即查看</span>';
|
||||
|
||||
var banner = $('<a href="http://www.mawen.co/question/405" style="color: #333333;" target="_blank"><div style="' + styleStr + '">' + text + '</div></a>')
|
||||
.insertAfter(element);
|
||||
@ -269,7 +270,7 @@ function create_page_anchors() {
|
||||
.addClass('content-toc')
|
||||
.attr('id', 'content-toc');
|
||||
|
||||
// create_banner(ul_tag);
|
||||
create_banner(ul_tag);
|
||||
|
||||
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>');
|
||||
|
Loading…
x
Reference in New Issue
Block a user