new
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
// 代码块收缩
|
||||
|
||||
$(function () {
|
||||
var $code_expand = $('<i class="fas fa-angle-up code-expand" aria-hidden="true"></i>');
|
||||
|
||||
$('.code-area').prepend($code_expand);
|
||||
$('.code-expand').on('click', function () {
|
||||
if ($(this).parent().hasClass('code-closed')) {
|
||||
$(this).siblings('pre').find('code').show();
|
||||
$(this).parent().removeClass('code-closed');
|
||||
} else {
|
||||
$(this).siblings('pre').find('code').hide();
|
||||
$(this).parent().addClass('code-closed');
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user