Skip to content

Instantly share code, notes, and snippets.

@ntorgov
Created January 16, 2019 11:04
Show Gist options
  • Save ntorgov/183c45fd8fadc2d5b615ac6106ff26f0 to your computer and use it in GitHub Desktop.
Save ntorgov/183c45fd8fadc2d5b615ac6106ff26f0 to your computer and use it in GitHub Desktop.
Пропущенная функция
function switchActivate() {
$('.account-check').each(function () {
var $this = $(this),
link = $this.find('.account-check__link'),
link_active = $this.find('.account-check__link.active'),
link_active_width = link_active.outerWidth(),
link_sum_width = 0;
$this.append('<div class="account-check__block"></div>');
var check_block = $('.account-check__block');
check_block.css({'width': link_active_width});
link.each(function () {
link_sum_width = $(this).outerWidth() + link_sum_width;
})
$this.closest('.account-check__parent').css({'width': link_sum_width + 1});
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment