-
-
Save Robin-bob/3e5a2f2b2e83872d5c9a61c15dd2b29f to your computer and use it in GitHub Desktop.
cateogry dropdown in the menu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.page-header__nav { | |
overflow: visible; | |
} | |
.tutorials-select__header { | |
font-size: 1.5rem; | |
font-weight: 300; | |
color: #39b6b3; | |
} | |
.tutorials-select__header:after { | |
content: ''; | |
display: block; | |
position: absolute; | |
top: 11px; | |
right: 6px; | |
border: 3px solid transparent; | |
border-top: 6px solid #39b6b3; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<li> | |
<div class="tutorials-select"> | |
<span class="tutorials-select__header"> | |
{% if category %} | |
{{ category.title }} | |
{% else %} | |
{{ settings.data.texts.all_categories }} | |
{% endif %} | |
</span> | |
<div class="tutorials-select__content"> | |
<a href="/catalog" class="tutorials-select__content-item {% if template == 'catalog'%} active {% endif %}">{{ settings.data.texts.all_categories }}</a> | |
{% for cat in catalog.categories %} | |
{% capture url_href %}/categories/{{ cat.slug }}{% endcapture %} | |
{% if cat.programs_count > 0 %} | |
<a href="{{ url_href }}" class="tutorials-select__content-item {% if cat.slug == category.slug %} active {% endif %}">{{ cat.title | spoiler, 30 }}</a> | |
{% endif %} | |
{% endfor %} | |
</div> | |
</div> | |
</li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// open select-content | |
$('.tutorials-select__header').on('click', function() { | |
// hide search rezult | |
$('.tutorial-search__rezult').hide(); | |
$('.tutorials-select__content').hide(); | |
$(this).parents('.tutorials-select').find('.tutorials-select__content').toggle(); | |
$(this).toggleClass('traingle-down'); | |
return false; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment