mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2026-06-08 04:48:10 +08:00
完善data-tips-text支持自定义颜色data-tips-color
This commit is contained in:
parent
ec768a6e2a
commit
b929646495
@ -1005,7 +1005,9 @@ $(function () {
|
|||||||
|
|
||||||
/*! 注册 data-tips-text 事件行为 */
|
/*! 注册 data-tips-text 事件行为 */
|
||||||
$.base.onEvent('mouseenter', '[data-tips-text]', function () {
|
$.base.onEvent('mouseenter', '[data-tips-text]', function () {
|
||||||
let opts = {tips: [$(this).attr('data-tips-type') || 3, '#78BA32'], time: 0};
|
// 获取自定义颜色(优先取 data-tips-color,否则用默认色)
|
||||||
|
const color = $(this).attr('data-tips-color') || '#78BA32';
|
||||||
|
let opts = {tips: [$(this).attr('data-tips-type') || 3, color], time: 0};
|
||||||
let layidx = layer.tips($(this).attr('data-tips-text') || this.innerText, this, opts);
|
let layidx = layer.tips($(this).attr('data-tips-text') || this.innerText, this, opts);
|
||||||
$(this).off('mouseleave').on('mouseleave', function () {
|
$(this).off('mouseleave').on('mouseleave', function () {
|
||||||
setTimeout("layer.close('" + layidx + "')", 100);
|
setTimeout("layer.close('" + layidx + "')", 100);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user