html页面隐藏元素时闪烁,javascript – 不需要的HTML元素闪烁

当我在我正在使用的图像上拖动元素时遇到闪烁问题时,我正在为一个项目工作快速笔.不确定这里发生了什么,当你最初加载笔并第一次将它翻过来时,似乎没有出现这个问题,但之后它开始出现问题.

片段演示:

$(document).bind('mousemove', function(e){

$('.tagger').css({

left: e.pageX - 55,

top: e.pageY - 55

});

});

$('#crowd').hover(function(){

$('.tagger').show();

});

$('#crowd').mouseleave(function(){

$('.tagging').attr('class', 'tagger');

$('.tagger').hide();

});

$('#crowd').click(function(){

$('.tagging').attr('class', 'tagger');

});

$('.tagger').click(function(){

$('.tagger').attr('class', 'tagging');

});

$(document).on('click', '.tagging li', function(){

alert($(event.target).text());

});

.tagger {

top: 0px;

left: 0px;

position: absolute;

z-index: 3;

}

.tagger .frame {

position: relative;

height: 100px;

width: 100px;

padding: 0px;

border: 5px;

border-style: solid;

border-color: red;

}

.tagger .name {

display: none;

position: relative;

top: -5px;

height: 90px;

width: 90px;

padding: 5px;

border: 5px;

border-style: solid;

border-color: red;

background-color: white;

}

.tagger .name ul {

list-style: none;

padding: 0px;

margin: 0px;

display: inline-block;

}

.tagging {

position: absolute;

z-index: 3;

}

.tagging .frame {

position: relative;

height: 100px;

width: 100px;

padding: 0px;

border: 5px;

border-style: solid;

border-color: red;

}

.tagging .name {

position: relative;

top: -5px;

height: 90px;

width: 90px;

padding: 5px;

border: 5px;

border-style: solid;

border-color: red;

background-color: white;

}

.tagging .name ul {

list-style: none;

padding: 0px;

margin: 0px;

display: inline-block;

}

364391c1c7eaf2329b82eea68e5cfaba.png

  • One
  • Two
  • Three
  • Fork
  • Fyve

$(document).bind('mousemove', function(e){

$('.tagger').css({

left: e.pageX - 55,

top: e.pageY - 55

});

});

$('#crowd').hover(function(){

$('.tagger').show();

});

$('#crowd').mouseleave(function(){

$('.tagging').attr('class', 'tagger');

$('.tagger').hide();

});

$('#crowd').click(function(){

$('.tagging').attr('class', 'tagger');

});

$('.tagger').click(function(){

$('.tagger').attr('class', 'tagging');

});

$(document).on('click', '.tagging li', function(){

alert($(event.target).text());

});

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值