让QTip工具提示不要离开屏幕?(绑在身上?)

jma*_*erx 0 javascript jquery

我有QTips:

eventRender: function (event, element, view) {
    element.qtip({
        content: event.title + event.hours,
        position:{
            target: 'mouse'
        },
        //  show: { event: 'click' },
        hide: { event: 'mousedown mouseleave' },
        style: { 
            width: 200,
            padding: 5,
            color: 'black',
            textAlign: 'left',
            border: {
                width: 1,
                radius: 3
            },
            classes: 'custSideTip'
        } 
    });
}
Run Code Online (Sandbox Code Playgroud)

CSS:

.custSideTip
{
    position:fixed !important;
    right:0 !important;
    max-width:200px !important;
}
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

但他们离开了页面......

我尝试了正确的固定位置,似乎没有任何工作......

尖端的正确坐标不应超过body.right/page.right ...如果这有意义..

谢谢

小智 7

取自这里.

您可以尝试使用viewport配置:

position: { viewport: $(window) }
Run Code Online (Sandbox Code Playgroud)