为什么qTip工具提示框不会保持打开状态,以便我可以在其上单击链接?

4

这是我在jsfiddle中的示例,将鼠标悬停在明尼苏达州上看到qtip弹出窗口。我正在使用qTip jquery插件,但我却不知道如何让qtip保持足够长的时间,以便用户可以单击tooltip上的链接。我已经尝试过各种场景来使其保持打开状态。阅读文档,似乎很容易做到,但我尝试了这些方法都没有成功。我尝试过以下方法:

hide: { when: 'mouseout', fixed: true }

并且。
hide: { fixed: true, delay: 1000 }

许多其他的方法都不能保持工具提示一直显示,以便用户可以点击链接。而令人烦恼的是,在参考文档页面上,如果您点击任何示例链接,它们都会执行我想要的操作,但当我查看源代码时,它们似乎使用了

标签。

  hide: 'unfocus',

and

     hide: {
        fixed: true,
        delay: 240
     },

但我尝试了两种方法,工具提示框仍然没有停留开启。我是否遗漏了什么?
2个回答

7

由于您的提示位置似乎偏向右侧,因此请尝试以下操作:

  $(this).qtip(
  {
      hide:{ //moved hide to here,
        delay:500, //give a small delay to allow the user to mouse over it.
        fixed:true
      },
     content: $("." + test).html(),
     style: {
        name: 'dark',
         style: {
            border: 1,
            cursor: 'pointer',
            padding: '5px 8px',
            name: 'blue'
         },
        border: {}, 
        tip: true // Apply a tip at the default tooltip corner
     }
  });

Updated fiddle.


1

你的代码中有两种风格,看起来有点混乱。这是你的代码,已经可以正常工作了。

http://jsfiddle.net/JDVTM/


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接