jquery - 在 qtip 工具提示上手动定位调整(不工作)

标签 jquery css position qtip

 $('#nav a[href][title]').qtip({
      content: {
         text: false // Use each elements title attribute
      },
      position: {
     corner: {
        target: 'topLeft',
        tooltip: 'middleRight'
                }
                },
     style: {
       name: 'dark',
       width: 230,
       padding: 3,
       bottom: 10,
       textAlign: 'center'
      }
 // Give it some style
   });

我想模拟:css: position:relative;bottom:10px 以便工具提示与目标垂直对齐(见图片),但我无法完成

enter image description here

这样尝试

$('#nav a[href][title]').qtip({
      content: {
         text: false // Use each elements title attribute
      },
      position: {
     corner: {
        target: 'topLeft',
        tooltip: 'middleRight'
                }
                },
     style: {
       name: 'dark',
       width: 230,
       padding: 3,
       position: 'relative',
       bottom: 10,
       textAlign: 'center'
      }
 // Give it some style
   });

但是工具提示的文本被移动,而不是工具提示本身,

我该怎么做?

编辑

尝试“调整”属性,但我找不到语法错误

$('#nav a[href][title]').qtip({
      content: {
         text: false // Use each elements title attribute
      },
      position: {

      adjust: {
              x: 10px,
              y: 10px
       },

     corner: {
               target: 'topLeft',
               tooltip: 'middleRight'
                }
     },
     style: {
       name: 'dark',
       width: 230,
       padding: 3,
       textAlign: 'center'
      },
 // Give it some style
   });

最佳答案

您可以使用“position”属性组的“adjust”属性,如下所示:

position: {
    corner: {
        target: 'topLeft',
        tooltip: 'middleRight'
        },
    adjust: {
        x: 10,
        y: 10
        }
    }

我提供的数字是任意的。您可以随心所欲地摆弄它们。

关于jquery - 在 qtip 工具提示上手动定位调整(不工作),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6002967/

相关文章:

javascript - 在一些 jquery wordpress 中 Hook 时遇到问题

悬停 addClass 上的 jQuery

html - 用base64编码图像有什么效果?

html - 如何制作响应式缩略图?

jquery - 如何使用 Owl Carousel 2 检索基本信息

jquery - 如何用一个 MySQL 查询填充多个输入字段

javascript - 当子元素悬停在父元素之上时,如何为父元素和子元素分配不同的行为?

Jquery 鼠标滚轮检测滚动位置工作不正确

php - 相对定位导致的 HTML 布局额外间距

excel - 用单元格确定形状位置