Hello. I added a second language to my www.mayaandluca.com site with the Translate & Adapt application. But I want to put country flag images next to these 2 language options to make it clear. Can you help me with this?
- Go to Online Store > Themes > Edit Code.
- Open the file where you have added option of language.
- Find class β.localization-form__content-itemβ
- Add SVG/Img before the Language buttons tag starts in ββ with proper Class/ID to the βImgβ tag.
- Add CSS to this Class
- Add same SVG/Img that you added above and with same Class/ID name before the " " tag
For reference, the expected output after executing this code will appear as follows: https://prnt.sc/mMPLbwnlCLNQ
.localization-form__content-item{
display: flex;
}
.imgLanguageIcon {
background-color: white;
}
.imgLanguageIcon.selected {
background-color: #ebebeb;
}
- Write this code inside the tag
$(document).ready(function() {
$('.localization-form__content-item').on('click', function() {
if ($(this).hasClass('localization-form__content-item--selected')) {
$(this).removeClass('localization-form__content-item--selected');
$('.imgLanguage').css('background-color', 'white');
} else {
$('.localization-form__content-item').removeClass('localization-form__content-item--selected');
$(this).addClass('localization-form__content-item--selected');
$('.imgLanguage').css('background-color', '#ebebeb');
}
});
});
1 Like
Thank you