全日历 +全天活动的 QTips 挂起
我正在使用 qtip 的实现,该实现在“AllDay”事件栏鼠标悬停时触发。
它倾向于正确弹出“qtip”,但当鼠标移动到日历的启用区域之外时,会挂起而不是关闭/隐藏 qtip。
您可以通过将鼠标快速移入和移出 http://jsfiddle 上的日历区域 div 来重现问题。 net/GxXrW/8/ 页面。
您对强制隐藏“qtip”有什么想法吗?这是我的实现:
eventMouseover: function(event, jsEvent, view) {
clearTimeout(qtipTimeout);
if (suspendTooltips || $(this).data('qtip')) {
return;
}
$(this).qtip({
content: {
text: '...removed...',
prerender: true
},
show: {
solo: true,
when: 'mouseover',
delay: 800, //increased wait-time to not have unwanted qtips fire
effect: {
type: 'slide',
length: 285
}
},
hide: {
effect: {
type: ''
}
},
position: {
target: 'mouse',
adjust: {
x: 10,
y: 4,
mouse: true,
screen: true,
scroll: false,
resize: false
},
corner: {
target: 'bottomLeft',
tooltip: 'topLeft'
}
},
style: {
tip: 'topLeft',
padding: 10,
background: event.bgColor, //driven from array generated elsewhere
color: event.fgColor, // ''
border: {
width: 2,
radius: 7,
color: event.bdrColor // ''
},
width: 365
},
api: {
onRender: function() {
var self = this;
qtipTimeout = setTimeout(function() {
self.show();
}, 450);
},
beforeShow: function() {
return (!suspendTooltips);
}
}
});
I'm using a implementation of qtip that fires on 'AllDay' event-bar mouse-overs.
It has a tendency to pop the 'qtip' correctly, but than hang and not close/hide the qtip when the mouse has moved outside of the enabled area of the calendar.
You can recreate the problem by quickly moving the mouse in and out of the calendar area div on the http://jsfiddle.net/GxXrW/8/ page.
Do you have any thoughts on force hiding the 'qtip'- here is my implementation:
eventMouseover: function(event, jsEvent, view) {
clearTimeout(qtipTimeout);
if (suspendTooltips || $(this).data('qtip')) {
return;
}
$(this).qtip({
content: {
text: '...removed...',
prerender: true
},
show: {
solo: true,
when: 'mouseover',
delay: 800, //increased wait-time to not have unwanted qtips fire
effect: {
type: 'slide',
length: 285
}
},
hide: {
effect: {
type: ''
}
},
position: {
target: 'mouse',
adjust: {
x: 10,
y: 4,
mouse: true,
screen: true,
scroll: false,
resize: false
},
corner: {
target: 'bottomLeft',
tooltip: 'topLeft'
}
},
style: {
tip: 'topLeft',
padding: 10,
background: event.bgColor, //driven from array generated elsewhere
color: event.fgColor, // ''
border: {
width: 2,
radius: 7,
color: event.bdrColor // ''
},
width: 365
},
api: {
onRender: function() {
var self = this;
qtipTimeout = setTimeout(function() {
self.show();
}, 450);
},
beforeShow: function() {
return (!suspendTooltips);
}
}
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您上面的实现看起来像 qTip1 格式,但您链接到的小提琴是 qTip2,所以这里可能有两个答案。
在链接的 qTip2 jsFiddle 的情况下,“问题”是由于使用 unfocus 作为隐藏事件(用户必须显式单击其他位置)与独奏设置相结合。但这并不是一个真正的错误。发生的情况是,solo:true 设置会导致每次您将鼠标悬停在另一个日历日时,qTips 都会隐藏,直到您到达日历的边缘 - 那里不再有 qTips 来触发任何可见提示的隐藏事件。
将其更改为使用 hide.fixed 并稍有延迟(以允许用户将鼠标移至提示中),似乎可以解决该版本的问题:
http://jsfiddle.net/kiddailey/GxXrW/21/
至于 qTip1 示例,我不太确定它为什么会执行您所描述的操作。您可能想要删除一些额外的 qTip 功能(即动画效果和延迟),并查看这是否会对行为产生影响。它可能只是鼠标移动和事件触发之间的时间间隔导致问题。
如果您发布 qTip1 版本的工作 jsFiddle,我会很乐意再看一眼。
Your implementation above looks like qTip1 format, but the fiddle you linked to is qTip2, so there's probably two answers here.
In the case of the linked qTip2 jsFiddle, the "issue" is due to using unfocus as the hide event (where the user has to explicitly click somewhere else) combined with the solo setting. It's not really a bug though. What is happening is that the solo:true setting is causing qTips to hide each time you mouseover another calendar day, UNTIL you get to the edges of the calendar -- where there are no more qTips to trigger the hide event of any visible tips.
Changing it to use hide.fixed with a slight delay (to allow the user to mouse into the tip), seems to resolve the issue with that version:
http://jsfiddle.net/kiddailey/GxXrW/21/
As for the qTip1 example, I'm not exactly sure why it is doing what you describe. You might want to remove some of the extra qTip features (namely the animation effects and delays) and see if that makes a difference in the behavior. It could simply be the timing between the mouse movement and when events are being triggered causing a problem.
If you post a working jsFiddle of the qTip1 version I'll gladly take a second look.