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

Fixed Tooltip Problem

Discussion in 'Resolved Bug Reports' started by ragtek, Jul 26, 2012.

  1. ragtek

    ragtek Guest

    If i add a Tooltip to the Menu or another element which is a popup, the Tooltip isn't placed right. (hope you know what i mean^^)

    Video (i hope it describes it better^^) http://ragtek.github.com/videos/bug.htm
     
  2. MagnusB

    MagnusB Well-Known Member

    My guess is that the drop downs are all absolutely positioned, while your tool tips are relatively positioned. If I am not mistaken, you will need to absolutely position the tool tips as well.
     
    Adam Howard likes this.
  3. ragtek

    ragtek Guest

    it's not "my tooltip" it's the default function from xenforo
    Code:
    /**
    * Wrapper for jQuery Tools Tooltip
    *
    * @param jQuery .Tooltip
    */
    XenForo.Tooltip = function($element)
    {
    var tipClass = String($element.data('tipClass') || ''),
    isFlipped = /(\s|^)flipped(\s|$)/.test(tipClass),
    offsetY = parseInt($element.data('offsetY')) || -6,
    offsetX = parseInt($element.data('offsetX')) + $element.innerWidth() * (isFlipped ? 1 : -1),
    title = XenForo.htmlspecialchars($element.attr('title'));
     
    if (!offsetX)
    {
    setTimeout(function()
    {
    offsetX = $element.innerWidth() * (isFlipped ? 1 : -1);
     
    $element.data('tooltip').getConf().offset = XenForo.switchOffsetRTL([ offsetY, offsetX ]);
    }, 500);
    }
     
    $element.attr('title', title).tooltip(XenForo.configureTooltipRtl(
    {
    delay: 0,
    position: $element.data('position') || 'top ' + (isFlipped ? 'left' : 'right'),
    offset: [ offsetY, offsetX ],
    tipClass: 'xenTooltip ' + tipClass,
    layout: '<div><span class="arrow" /></div>'
    }));
    };
     
    Adam Howard likes this.
  4. MagnusB

    MagnusB Well-Known Member

    I still think it is a problem with position:absolute vs position:relative, and the js expects the position to be relative. Javascript is usually gibberish to me though.

    EDIT:
    Trying to reproduce it with developer tools on other items using tool tip, not being able to do so. I am thinking the fact that it corrects it self is a pretty big tip to what is going on, I just can't get it.
     
    1 person likes this.
  5. Mike

    Mike XenForo Developer Staff Member

    Should have this sorted now.
     
    Eagle, Slavik, Pereira and 2 others like this.

Share This Page