开发者

How can i make my qtip decide on his own to Left or Right tip attribute

开发者 https://www.devze.com 2023-02-13 07:47 出处:网络
$(\'a.tooltip\').each(function(){ $(this).qtip({ content开发者_开发百科: { url: \'includes/qtip.php?\'+$(this).attr(\'rel\')+\' #\'+$(this).attr(\'div\'), text:\'loading...\'},
$('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
         }
    });
});

Which I love wen the .tooltip item is on the right panel of my website, but if not can't see it complete,

How can I make it tooltip:'right' when it's somewhere else? I mean, how can I know?


The solution in my similar to yours case was:

position : {
    adjust : {
        screen : true
    }
}

You may find more info in this thread: How to avoid page scroll when using qtip?


I think might be first time i answer my own question,

this works,

$('#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



       }




   });

});

can i optimize it?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号