【问题标题】:qTip pop ups come in from top left of screen (on first load)qTip 弹出窗口从屏幕左上角进入(首次加载时)
【发布时间】:2012-09-29 23:06:18
【问题描述】:

不确定我是否设置错误 - 我似乎没有看到其他人遇到此问题,但我的 qTip 弹出窗口(所有 ajax 加载的内容)加载非常不规律,因为它们经常从在出现在正确位置之前离开屏幕。有没有我可能错过的简单解决方案?再次感谢您的帮助。

HTML 标记:

    <span class="formInfo">
   <a href="http://localhost/httpdocs/index.php/help/kc_dob" class="jTip" name="" id="dob_help">?</a>
</span>

qTip 初始化..

    //set up for qtip
   function initQtip()
   {
         $('a.jTip').each(function()
            {
               $(this).qtip(
               {
                 content: {
                     // Set the text to an image HTML string with the correct src URL to the loading image you want to use
                     text: '<img src="/media/images/wait.gif" alt="Loading..." />',
                     url: $(this).attr('href') // Use the rel attribute of each element for the url to load
                  },
                  position: {
                     adjust: {
                           screen: true // Keep the tooltip on-screen at all times
                     }
                  },
                  show: { 
                  when: 'click', 
                     solo: true // Only show one tooltip at a time
                  },
                  hide: 'unfocus',
                  style: {
                     tip: true, // Apply a speech bubble tip to the tooltip at the designated tooltip corner
                     border: {
                           width: 10,
                           radius: 10
                     },
                  width: {
                     min: 200, 
                     max: 500
                  },
                     name: 'light' // Use the default light style
                  }
               });
            //prevent default event on click
            }).bind('click', function(event){ event.preventDefault(); return false; });
      }

【问题讨论】:

    标签: jquery jquery-plugins qtip


    【解决方案1】:

    看看这样做是否有帮助:

    show: { delay: 0, effect: { type: 'fade', length: 0 } }
    

    【讨论】:

      【解决方案2】:

      我知道这是旧的,但我在寻找解决方案时发现了这一点,而在 Google 上并没有太多其他内容。如果您没有在 HTML 标头中实现 jquery.ui.position.js,则会发生这种情况:

      <script src="javascript/ui/jquery.ui.position.js"></script>
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-05-03
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-03-10
        • 1970-01-01
        相关资源
        最近更新 更多