layer实现鼠标悬停tips方法

layer实现鼠标悬停tips方法

2016-11-03 / 0 评论 / 106 阅读 / 正在检测是否收录...
温馨提示:
本文最后更新于2021年10月27日,已超过926天没有更新,若内容或图片失效,请留言反馈。

封装代码

function hovertip(dom, text, direction, color) {
    dom.hover(function() {
        $tip(text, this, direction, color);
    }, function() {
        layer.closeAll('tips');
    });
}
// tip
function $tip(text, dom, direction, color) {
    layer.tips(text, dom, {
        tips : [ direction ? direction : 3, color ? color : '#393D49' ]
    });
}

使用代码

hovertip($('.main-menu li').has('.icon-off'), '退出登录', 1);

0

评论 (0)

取消