Created
February 22, 2017 19:55
-
-
Save alesanabriav/9ce5fcff4b80d0eb91701e266b035202 to your computer and use it in GitHub Desktop.
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
<button class="dropdown"> | |
DE <i class="ion-chevron-down"></i> | |
<div class="dropdown__content"> | |
<a href="http://africa.acninternational.org/sw/fr">FR</a> | |
<a href="http://africa.acninternational.org/sw/it">IT</a> | |
</div> | |
</button> | |
<button class="dropdown"> | |
FR <i class="ion-chevron-down"></i> | |
<div class="dropdown__content"> | |
<a href="http://africa.acninternational.org/sw/de">DE</a> | |
<a href="http://africa.acninternational.org/sw/it">IT</a> | |
</div> | |
</button> | |
<button class="dropdown"> | |
IT <i class="ion-chevron-down"></i> | |
<div class="dropdown__content"> | |
<a href="http://africa.acninternational.org/sw/de">DE</a> | |
<a href="http://africa.acninternational.org/sw/fr">FR</a> | |
</div> | |
</button> | |
<style> | |
.dropdown { | |
position: relative; | |
display: inline-block; | |
} | |
.dropdown__content { | |
display: none; | |
position: absolute; | |
background-color: #f9f9f9; | |
min-width: 160px; | |
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); | |
z-index: 1; | |
} | |
.dropdown__content--active { | |
display:block; | |
} | |
</style> | |
<script> | |
$('.dropdown').on('click', function() { | |
if((this).find('.dropdown__content').addClass('.dropdown__content--active')) { | |
$(this).find('.dropdown__content').removeClass('.dropdown__content--active'); | |
} else { | |
$(this).find('.dropdown__content').addClass('.dropdown__content--active'); | |
} | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment