EasyUI中ToolTip提示框的简单使用

场景

效果

属性

名称类型描述默认值
positionstring提示框(tooltip)位置。可能的值:'left'、'right'、'top'、'bottom'。bottom
contentstring提示框(tooltip)内容。null
trackMouseboolean如果设置为 true,提示框(tooltip)会随着鼠标移动。false
deltaXnumber提示框(tooltip)位置的水平距离。0
deltaYnumber提示框(tooltip)位置的垂直距离。0
showEventstring引发提示框(tooltip)出现的事件。mouseenter
hideEventstring引发提示框(tooltip)消失的事件。mouseleave
showDelaynumber显示提示框(tooltip)的时间延迟。200
hideDelaynumber隐藏提示框(tooltip)的时间延迟。100

事件

名称参数描述
onShowe当显示提示框(tooltip)时触发。
onHidee当隐藏提示框(tooltip)时触发。
onUpdatecontent当提示框(tooltip)内容更新时触发。
onPositionleft,top当提示框(tooltip)位置改变时触发。
onDestroynone当提示框(tooltip)销毁时触发。

方法

名称参数描述
optionsnone返回选项(options)属性(property)。
tipnone返回提示(tip)对象。
arrownone返回箭头(arrow)对象。
showe显示提示框(tooltip)。
hidee隐藏提示框(tooltip)。
updatecontent更新提示框(tooltip)内容。
repositionnone重置提示框(tooltip)位置。
destroynone销毁提示框(tooltip)。


实现

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" type="text/css" href="/easyui/themes/icon.css">
    <link rel="stylesheet" type="text/css" href="/easyui/themes/default/easyui.css">
    <script type="text/javascript" src="/easyui/jquery.min.js"></script>
    <script type="text/javascript" src="/easyui/jquery.easyui.min.js"></script>
</head>
<body>
<a href="#" title="This is the tooltip message." class="easyui-tooltip">Hover me</a>
<a id="dd" href="javascript:void(0)">Click here</a>
<script type="text/javascript">
    $('#dd').tooltip({
        position: 'right',
        content: '<span style="color:#fff">This is the tooltip message.</span>',
        onShow: function(){
            $(this).tooltip('tip').css({
                backgroundColor: '#666',
                borderColor: '#666'
            });
        }
    });
</script>
</body>
</html>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

霸道流氓气质

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值