6
$('a.tooltip').each(function(){
    
    $(this).qtip({
        content: { url: 'includes/qtip.php?'+$(this).attr('rel')+' #'+$(this).attr('div'), text:'loading...'  },
        show: { delay: 400},
        hide: { fixed: true, delay: 200 },
        position: {
            corner: {
                target: 'bottomLeft',
                tooltip: 'right'
            }
         },
         style: {
             name: 'light',
             width: 700
         }
    });
});

我喜欢 .tooltip 项目位于我网站的右侧面板上,但如果不是,则看不到它的完整,

tooltip:'right'当它在其他地方时,我怎么能做到?我的意思是,我怎么知道?

4

2 回答 2

9

我与您的情况类似的解决方案是:

position : {
    adjust : {
        screen : true
    }
}

您可以在此线程中找到更多信息: 使用 qtip 时如何避免页面滚动?

于 2012-02-17T11:53:24.900 回答
1

我想可能是我第一次回答自己的问题,

这有效,

$('#panel_derecho a.tooltip').each(function(){

  $(this).qtip({
     content: { url: 'includes/qtip.php?'+$(this).attr('rel')+' #'+$(this).attr('div'), text:'loading...'  },

     show: { delay: 400},
     hide: { fixed: true, delay: 200 },

     position: {
     corner: {
        target: 'topLeft',
        tooltip: 'middleRight'
                }
                },
     style: {
       name: 'light',
       width: 700



       }




   });

});

$('#router a.tooltip').each(function(){

  $(this).qtip({
     content: { url: 'includes/qtip.php?'+$(this).attr('rel')+' #'+$(this).attr('div'), text:'loading...'  },

     show: { delay: 400},
     hide: { fixed: true, delay: 200 },

     position: {
     corner: {
        target: 'topLeft',
        tooltip: 'left'
                }
                },
     style: {
       name: 'light',
       width: 700



       }




   });

});

我可以优化它吗?

于 2011-02-26T01:57:11.180 回答