【HTML悬浮提示】

18 篇文章 0 订阅
13 篇文章 0 订阅

在这里插入图片描述

function txm1Function() {
	tip("txm1", "最大长度不得超过30", false);
}

function tip(id, msg, flag) {
	flag = typeof flag == 'undefined' ? true : flag;
	var html = '<span class="category-pop">' +
		'<s class="pop-l"><</s>' +
		'<a href="javascript:void(0)">' + msg + '</a>' +
		'<s class="pop-r"></s>' +
		'</span>';
	var offset = $('#' + id).offset();
	if (flag) {
		$('#' + id).unbind('hover').hover(function () {
			$(this).after($(html).css({top: offset.top, left: offset.left + $(this).width() - 80}));
		}, function () {
			$('span.category-pop').remove();
		});
	} else {
		$('span.category-pop').remove();
		$('#' + id).after($(html).css({top: offset.top, left: offset.left + $('#' + id).width() - 80}));
	}
};
.category-pop {
	top: 8px;
	height: 21px;
	position: absolute;
	background-color: #FFF8D9;
	border: 1px solid #FEBE8F;
	margin-left: 95px;
}
.category-pop .pop-l {
	left: -9px;
	color: #FEBE8F;
	position: absolute;
	transform: rotate(-25deg);
	display: inline-block;
	z-index: -1;
}
.category-pop s {
	display: inline-block;
	position: absolute;
	top: 1px;
	width: 7px;
	height: 23px;
}
.category-pop a {
	font-weight: normal;
	font-size: 12px;
	color: #F60;
	width: auto;
	height: 21px;
	line-height: 21px;
	margin: 0;
	text-indent: 0;
	padding: 0 7px 1px;
	text-decoration: none;
}
.category-pop .pop-r {
	right: -1px;
}

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值