@@ -95,6 +95,8 @@ function init_sidebar_section() {
95
95
}
96
96
location . hash = menu [ i + 1 ] ;
97
97
} ) ;
98
+ create_banner ( $ ( ditto . sidebar_id ) . find ( 'p:nth-child(3)' ) . first ( ) ) ;
99
+
98
100
} , "text" ) . fail ( function ( ) {
99
101
alert ( "Opps! can't find the sidebar file to display!" ) ;
100
102
} ) ;
@@ -208,19 +210,24 @@ function li_create_linkage(li_tag, header_level) {
208
210
}
209
211
210
212
function create_banner ( element ) {
213
+ // 2019年11月20日
214
+ var deadline = new Date ( 2019 , 10 , 20 ) ;
215
+ if ( deadline - ( new Date ( ) ) < 0 ) return ;
216
+
211
217
var styleStr = [
212
218
'margin: 1em 0' ,
213
219
'padding: 1em' ,
214
220
'background-color: #c4e0e1' ,
215
221
'border-radius: 5px' ,
216
- 'font-size: 90%'
222
+ 'font-size: 75%' ,
223
+ 'color: #333333'
217
224
] . join ( ';' ) ;
218
225
219
- var text = '<a href="">Vue 实战教程</a > ' +
220
- '深入学习一线大厂必备 Vue 技能。VIP 教程限时免费领取。' +
221
- '<a href=" ">⇐ 立即查看</a >' ;
226
+ var text = '<span style="color: #4682BE;">ES6 实战教程</span > ' +
227
+ '深入学习一线大厂必备 ES6 技能。VIP 教程限时免费领取。' +
228
+ '<span style="color: #4682BE; ">⇐ 立即查看</span >' ;
222
229
223
- var banner = $ ( '<div style="' + styleStr + '">' + text + '</div>' )
230
+ var banner = $ ( '<a href="http://www.mawen.co/question/405" style="color: #333333;" target="_blank">< div style="' + styleStr + '">' + text + '</div></a >' )
224
231
. insertAfter ( element ) ;
225
232
}
226
233
@@ -261,7 +268,7 @@ function create_page_anchors() {
261
268
. addClass ( 'content-toc' )
262
269
. attr ( 'id' , 'content-toc' ) ;
263
270
264
- create_banner ( ul_tag ) ;
271
+ // create_banner(ul_tag);
265
272
266
273
for ( var j = 0 ; j < headers . length ; j ++ ) {
267
274
var li_tag = $ ( '<li></li>' ) . html ( '<a href="#' + location . hash . split ( '#' ) [ 1 ] + '#' + headers [ j ] + '">' + headers [ j ] + '</a>' ) ;
0 commit comments