Skip to content

Instantly share code, notes, and snippets.

@Postnov
Created May 25, 2020 12:32
Show Gist options
  • Save Postnov/9f22e1c4652237a56429e4dcbf58c2fa to your computer and use it in GitHub Desktop.
Save Postnov/9f22e1c4652237a56429e4dcbf58c2fa to your computer and use it in GitHub Desktop.
.list.js-list
.list-table
each i in [1,2,3,4,5,6,7,8,9,10]
if (i > 3)
.list-row(data-hidden)
//content
else
.lk-table-row
//row content
.btn Показать больше
$('.js-list .btn').click(function() {
var hiddenItems = $('.js-list').find('[data-hidden]');
if (hiddenItems.is(':visible')) {
$(this).text('Показать больше')
hiddenItems.css('display', 'none')
}else {
$(this).text('Скрыть')
hiddenItems.css('display', 'flex')
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment