views:

157

answers:

3

I'm messing around with FullCalendar jQuery calendar, and qTips, so that I can display more information about the event upon mouseover.

I've added a summary element to the FullCalendar js, and also my server code.

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.

What I want to do is to assign the qTip to the a tag, and make the a tags display block.

This works currently:

        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
                        }  
                    });

                }
            });

but I can't figure out how to select the a tag where it contains a span with class of fc-event-title.

Many thanks for any assistance.

A: 
$(span[class=myClass]).parent() 
Ivo Sabev
Thanks for the quick response, but adding the asterisk didn't make the a tag the center of attraction - it was still the span that was reffered to with the $(this).
Paul
+1  A: 

If it's a direct child:

$(span[class=fc-event-title]:parent)

Edit: Never mind, I was wrong. Although I do get it to work with the other answer:

$(span[class=fc-event-title]).parent()

Jakob
That is better solution.
Ivo Sabev
Haha, I'm loosing myself here :) I'll re-edit my answer when we get some feedback on what worked for mr Paul.
Jakob
A: 

Thanks to both Ivo and Jakob for their very quick responses.

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.

I'm loving javascript :).

Paul