版权声明:JiahaoZhang原创文章,转载请注明出处 https://blog.csdn.net/GrootBaby/article/details/84791482
.tips {
position: absolute;
z-index: 99;
background: rgba(0,0,0,0.5);
color: #fff;
}
(function ($) {
var $selectedViewList = $('#selectedViewList');
var $tips = $('#J_tips');
$selectedViewList.on('click', function(e) {
$tips = $('<div id="J_tips" class="tips"></div>');
$selectedViewList.append($tips);
var pageX = e.clientX,
pageY = e.clientY;
console.log(pageX,pageY);
$tips.text('这是点击的地方').css({
top: pageY,
left: pageX
});
console.log($tips);
});
})(jQuery);