// JavaScript Document function googleTranslateElementInit() { new google.translate.TranslateElement({ pageLanguage: 'zh-TW', includedLanguages: 'en,ja,ko,th,zh-CN,zh-TW', layout: google.translate.TranslateElement.InlineLayout.SIMPLE}, 'google_translate_element' ); } $(function(){ $('.toggleTrans').click(function(){ var offsetT = $(this).offset().top; var offsetL = $(this).offset().left; var h = $(this).outerHeight(); var scrollTop = $(window).scrollTop(); $('.goog-te-menu-frame').eq(0).toggle().css({top:offsetT-scrollTop+h, left:offsetL}); }); });