layui label提示文字及图标
未知
2023-09-07 10:16:31
0次
<div class="layui-form-item">
<label class="layui-form-label" style="width:111px">
短信渠道
<i class="layui-icon layui-icon-tips tooltip" data-content="需配置,用户扫码关注后即可登录"></i>
</label>
<div class="layui-input-block">
<input type="checkbox" {eq name='$login_set.login_wechat' value="1" }checked{/eq} name="login_wechat" lay-skin="switch" lay-filter="wx_swith" lay-text='是|否'>
</div>
</div>
<script>
// 出现提示文字
var tips;
$('.tooltip').on({
mouseenter: function() {
var that = this;
var content = $(this).data('content');
if (!content) return;
var maxWidth = $(this).data('width') || 300;
tips = layer.tips("<span style='color:#000;'>" + content + "</span>",
that,
{tips:[1,'#fff'],time:0,area: 'auto',maxWidth: parseInt(maxWidth)}
);
},
mouseleave: function() {
layer.close(tips);
}
});
</script>
相关内容