评论:鼠标工具提示js库V0.2  [查看原文]

所属分类:UI-悬停,工具提示

 33030  403  11
当前第1页 / 共1页
    王先森i0
    2022/11/2 23:50:58
    当鼠标的位置在页面底部的时候,弹出的层会被遮挡,作者大大能解决吗 回复
    凉风夜雨然?♂1
    2019/11/28 15:41:44

    mTips.s('回调调整提示框位置

    ', 'success ', function(){
    let tipWidth = $(".mTips").width();
    let tipHeight = $(".mTips").height();
    let tipLeft = $(".mTips").position().left;
    let tipTop = $(".mTips").position().top;
    let winWidth = document.body.clientWidth;
    let winHeight = document.body.clientHeight;
    
    let left = tipLeft + mTips.c.x;
    let top = tipTop + mTips.c.y;
    // 如果模块大于页面总宽或高,则重写计算位置
    if (tipLeft + tipWidth > winWidth) {
        left = tipLeft - tipWidth - mTips.c.x * 2;
    }
    if (tipTop + tipHeight > winHeight) {
        top = tipTop - tipHeight - mTips.c.y * 2;
    }
    $(".mTips").offset({
    top: top,
    left: left
    })
    });

    使用时需要在mTips.js 60行处

    $(document).on('mousemove'......{
                ...
                // 添加回调
                if (fun != null && typeof(fun) != 'undefined') {
                    fun();
                }
            }
    回复
    ╁?墨0
    2019/8/27 16:02:11
    提示能放入图片吗?
        吕纸乔0
        2019/8/29 11:35:10
        可以放入html代码,使用html代码模式
    回复
    yangyanyang0
    2018/11/29 17:19:14
    自定义样式mTips_? 还是mTips- 回复
    QQ^thunk0
    2018/5/4 9:01:18
    谢谢作者 ,同时温馨提示再修复下吧,就是当鼠标的位置在页面底部的时候,弹出的层会被遮挡
        王先森i0
        2022/11/2 23:51:35
        老哥,这个问题解决啦吗
    回复
    莫办蛮、0
    2018/4/12 16:12:14
    在option上不能用?
    回复
    YSY0
    2017/12/19 11:05:46
    谢谢作者 又实用又很棒的插件 回复
    zhaowucun130
    2017/11/27 16:14:38

    谢谢作者很强大的插件

    回复
    somebody0
    2017/10/31 9:32:04

    谢谢作者很强大的插件

    回复

讨论这个项目(11)回答他人问题或分享插件使用方法奖励jQ币 评论用户自律公约

取消回复