1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Popup windows appearing in the wrong place

Discussion in 'Troubleshooting and Problems' started by RCONN, Jan 19, 2012.

  1. RCONN

    RCONN Member

    Using XenForo 1.1.1

    Everything seems to be working OK in an unmodified installation. But when I try to add the Google Translate code to ad_header (I want it at the top right of the forum pages) :

    <divid="google_translate_element"style="float:right; font-size:small;"></div><scripttype="text/javascript">function googleTranslateElementInit(){new google.translate.TranslateElement({
    You can reproduce it by clicking on a forum, and then move the mouse over the thread titles (but don't click). You're supposed to get a popup appearing just above the mouse showing the first couple of lines of that thread. But what I (and my users) get is a popup appearing at the bottom of the page when I hover over the first thread, and nothing at all appearing for subsequent threads (probably trying to display below the bottom of the window).

    The popup windows that appear when you hover over a thread title in a forum no longer appear in the correct place -- the first one is at the bottom of the page and the subsequent ones don't appear at all (below the visible window?). When I switch back to the default style everything works as expected.

    The same thing happens when I tried putting it in ad_above_content, or in any other ad_* except the sidebar (which isn't a workaround because it's not visible on the messages page).

    Any ideas on how to fix / work around this?
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Moved from bug reports to troubleshooting.
  3. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Your tag names are messed up by lack of spacing. Use this:

    <div id="google_translate_element" style="float:right; font-size:small;"></div><script type="text/javascript">function googleTranslateElementInit(){new google.translate.TranslateElement({
    pageLanguage:'en'},'google_translate_element');}</script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
  4. RCONN

    RCONN Member

    Makes no difference; it does exactly the same thing. (My original script was multiline but got mangled somehow by the bbcode.)

    The script as supplied by Google (without the code block):

    <div id="google_translate_element" style="float:right"></div>
    <script type="text/javascript">
    function googleTranslateElementInit() {
    new google.translate.TranslateElement({
    pageLanguage: 'en'
    }, 'google_translate_element');
    </script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>

    (And yes, the </div> does look a little odd, but that's how Google had it, and moving it to the end makes no difference.)
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    I have confirmed the problem on my forum. It's obviously a conflict with Google's code since the problem only happens when that code is present. Unfortunately I don't have a fix for you.

Share This Page