Skip to content

Instantly share code, notes, and snippets.

@ArtemSites
Last active July 2, 2019 07:10
Show Gist options
  • Save ArtemSites/da4b5d9959844d6fe17aeb9bc23e1752 to your computer and use it in GitHub Desktop.
Save ArtemSites/da4b5d9959844d6fe17aeb9bc23e1752 to your computer and use it in GitHub Desktop.
Bitrix - редирект по повторному нажатию на кнопку.
$(document).ready(function() {
$('.services__header-item-btn').click(function() {
$(this).addClass('go-to-the-service');
$('.go-to-the-service').click(function() {
var link = $(this).attr('link');
window.location.href = link;
});
});
});
<?foreach ($arResult['SECTIONS'] as &$arSection):?>
<li class="services__header-item js-service-header-item">
<button link="<?=$arSection['~SECTION_PAGE_URL']?>"><?=$arSection['NAME']?></button>
</li>
<?//print('<pre style="display:none;">'); print_r($arSection);print('</pre>');?>
<?endforeach;?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment