Javascript 如何停用父项';儿童悬停游戏的标题是什么?

Javascript 如何停用父项';儿童悬停游戏的标题是什么?,javascript,jquery,html,css,Javascript,Jquery,Html,Css,这是我的密码: $.fn.right=函数(){ 返回$(document).width()-(this.offset().left+this.outerWidth()); } $(文档).ready(函数(){ $('a').bind('mouseenter',function(){ var self=$(这是); this.iid=setTimeout(函数(){ var tag_name=self.text(), 顶部=自身位置(), 右=self.right(); $('body').

这是我的密码:

$.fn.right=函数(){
返回$(document).width()-(this.offset().left+this.outerWidth());
}
$(文档).ready(函数(){
$('a').bind('mouseenter',function(){
var self=$(这是);
this.iid=setTimeout(函数(){
var tag_name=self.text(),
顶部=自身位置(),
右=self.right();
$('body').append(“关于“+tag_name+”的一些解释”);
$(“.tag_info”).css({top:top+“px”,right:right+“px”});
}, 525);
}).bind('mouseleave',function(){
如果(这个iid){
clearTimeout(this.iid)
$('.tag_info').remove();
}
});
});
正文{
填充:20px;
方向:rtl;
}
div{
填充:20px;
边框:1px纯色灰色;
}
a{
颜色:#3e6d8e!重要;
背景色:#E1ECF4;
填充物:2px 5px;
}
.tag_信息{
位置:绝对位置;
宽度:130px;
高度:100px;
显示:无;
背景色:黑色;
颜色:白色;
填充:10px;
}

长标签
标签

标题悬停是每个浏览器的内容

更好的选择是在添加悬停选项时删除
title
属性

/// somewhere in your hover in function
element.oldTitle = element.title;
element.title = '';


在mouseenter事件中添加以下代码:

$(this).parent().data('title', $(this).parent().attr('title'));
$(this).parent().attr('title', '');
。。鼠标上的这个:

$(this).parent().attr('title', $(this).parent().data('title') );
$.fn.right=函数(){
返回$(document).width()-(this.offset().left+this.outerWidth());
}
$(文档).ready(函数(){
$('a').bind('mouseenter',function(){
var self=$(这是);
$(this.parent().data('title',$(this.parent().attr('title'));
$(this.parent().attr('title','');
this.iid=setTimeout(函数(){
var tag_name=self.text(),
顶部=自身位置(),
右=self.right();
$('body').append(“关于“+tag_name+”的一些解释”);
$(“.tag_info”).css({top:top+“px”,right:right+“px”});
}, 525);
}).bind('mouseleave',function(){
$(this.parent().attr('title',$(this.parent().data('title'));
如果(这个iid){
clearTimeout(this.iid)
$('.tag_info').remove();
}
});
});
正文{
填充:20px;
方向:rtl;
}
div{
填充:20px;
边框:1px纯色灰色;
}
a{
颜色:#3e6d8e!重要;
背景色:#E1ECF4;
填充物:2px 5px;
}
.tag_信息{
位置:绝对位置;
宽度:130px;
高度:100px;
显示:无;
背景色:黑色;
颜色:白色;
填充:10px;
}

长标签
标签

这应该可以做到。当鼠标进入标记时,当前标题将在
oldTitle
属性中设置。当鼠标离开标记时,当前标题将从
oldTitle
属性中获取其旧值

$.fn.right=函数(){
返回$(document).width()-(this.offset().left+this.outerWidth());
}
$(文档).ready(函数(){
$('a').bind('mouseenter',function(){
var self=$(这是);
//获取标题并将其设置在div的新属性中
var container=$(this).closest('div');
container.attr('oldTitle',container.attr('title');
container.attr('标题','');
this.iid=setTimeout(函数(){
var tag_name=self.text(),
顶部=自身位置(),
右=self.right();
$('body').append(“关于“+tag_name+”的一些解释”);
$(“.tag_info”).css({top:top+“px”,right:right+“px”});
}, 525);
}).bind('mouseleave',function(){
如果(这个iid){
clearTimeout(this.iid)
$('.tag_info').remove();
//重新激活标题
var container=$(this).closest('div');
container.attr('title',container.attr('oldTitle'));
}
});
});
正文{
填充:20px;
方向:rtl;
}
div{
填充:20px;
边框:1px纯色灰色;
}
a{
颜色:#3e6d8e!重要;
背景色:#E1ECF4;
填充物:2px 5px;
}
.tag_信息{
位置:绝对位置;
宽度:130px;
高度:100px;
显示:无;
背景色:黑色;
颜色:白色;
填充:10px;
}

长标签
标签

你应该去掉title属性。@smerny我在
div
的其他区域需要它。如果你愿意,你可以用js删除/重新添加它(在显示弹出窗口的同时),标题只能在标签悬停时禁用,如问题中所述
$(this).parent().attr('title', $(this).parent().data('title') );