jQuery选择器:如何访问跨度为特定类别的标签? [英] jQuery Selectors: how to access an a tag, whose span has a specific class?
问题描述
我正在使用FullCalendar jQuery日历和qTips,以便在鼠标悬停时可以显示有关该事件的更多信息.
I'm messing around with FullCalendar jQuery calendar, and qTips, so that I can display more information about the event upon mouseover.
我已经向FullCalendar js中添加了一个summary元素,以及服务器代码.
I've added a summary element to the FullCalendar js, and also my server code.
然后我基于span类在eventMouseover方法中添加了一个新的qTip,该方法非常有效.但是,如果事件持续了几天,则qTip仅适用于文本本身(因为它是一个span标签),而不适用于整个蓝条.
I then added a new qTip in the eventMouseover method, based on the span class, which works prefectly. However, if the event stretches over a couple of days, the qTip only works (because it is a span tag), on the text itself, not the entire blue strip.
我要做的是将qTip分配给a标签,并使a标签显示块.
What I want to do is to assign the qTip to the a tag, and make the a tags display block.
当前有效:
eventMouseover: function(event){
$('span[class=fc-event-title]').each(function() {
if( $(this).text() == event.title )
{
$(this).qtip({
content: event.summary,
style:
{
border:
{
width: 1,
radius: 5,
color: '#6699CC'
},
width: 200
}
});
}
});
但是我不知道如何选择一个标签,其中包含具有fc-event-title类的跨度.
but I can't figure out how to select the a tag where it contains a span with class of fc-event-title.
非常感谢您的协助.
推荐答案
感谢伊沃(Ivo)和雅各布(Jakob)的迅速回应.
Thanks to both Ivo and Jakob for their very quick responses.
我通过更改FullCalendar在日历上创建标题的方式解决了这一问题.现在,当您将鼠标悬停在标题栏的非文本部分上时,qTip仍会显示.
I solved this by changing the way the FullCalendar creates the title on the calendar. Instead of it using a span, it now uses a div, and being block element, when you hover over a part of the title block which is not text, the qTip still shows.
我爱javascript:).
I'm loving javascript :).
这篇关于jQuery选择器:如何访问跨度为特定类别的标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!