I am designing a website with the CMS of Weebly. Unfortunately Weebly doesn't support multilingual websites, so I had to do it with JQuery. I found a script at http://blessingsweb.weebly.com/1/pos...th-weebly.html and added it to my website. The script hides the German menus, when you are on the English website and hides the English menus, when you are on the German Website. Everything is working, apart from the submenu on the German website. Somehow the script changed the position of the submenu and also the direction of the slide from left to right, to top to bottom.

Demo: http://mop000.weebly.com/startseite.html as you can see, the submenu has some strange behaviour.

If you click on the flag, you will see that on the English site everything is working well.

What can I do?

Code added as languages-1.0.js-file:

Code:
function hideMenus() {
lang = language.toLowerCase();
console.log('LANG: ' + lang);

currentLang = null;
menus = jQuery(menuSelector + ' ul li').each(function(){
    menu = jQuery(this);
    a = menu.children('a');
    span = a.children('span');
    if (span.length == 0) text = a.html();
    else text = span.html();
    text = text.toLowerCase();

    if (langs[text] != null) {
        currentLang = langs[text].toLowerCase();
        if (currentLang == lang) { 
            //if this is the first page of this language, we set the logo to go to this page url
            jQuery('.wsite-logo a').attr('href', a.attr('href'));
        }
    }
    show = (currentLang == lang);
    if (show) menu.show(); else menu.hide();
  console.log('MENU:' + text + ' - current lang: ' + currentLang + ' - in langs '+ langs[text] + ' - '+ (show ? 'SHOW' : 'HIDE'));
});
}

Code added in the header (SEO) of the website:

Code:
<script src="/files/theme/jquery-1.10.2.min.js"></script>
<script src="/files/theme/languages-1.0.js"></script>
<script>
langs = {          //everything in langs must be in lowercase
    'home': 'en',
    'startseite': 'de'
};
menuSelector = '#avmenu'; 
$(document).ready(function(){hideMenus()});
</script>

Code added on the German pages:

Code:
<script> language = 'de'; </script>
Code added on the English pages:

Code:
<script> language = 'en'; </script>
That's it. Thanks in advance!