Reputation: 637
I'm trying to learn qtip for fullcalendar but it doesnt seems to work. I´ve tried all tutorials/examples but nothing works as they say. I'm using the following code but I´ve tried many other alternatives. Am I doing any obvious fault?
dayClick: function(date, allDay, jsEvent, view) {
$(this).qtip({
content:"",
overwrite: false,
position: { corner: { target: 'topMiddle', tooltip: 'bottomMiddle' },
viewport: $(window), // Keep it on-screen at all times if possible
adjust: { x: 10, y: 10 } },
show: { when: 'click', // Don't specify a show event
ready: true // Show the tooltip when ready },
hide: { when: 'click' },
style: {
border: { width: 5, radius: 10 },
padding: 10,
textAlign: 'center', //tip: true,
// Give it a speech bubble tip with automatic corner detection name: 'cream'
// Style it according to the preset 'cream' style } }); }
Upvotes: 2
Views: 6897
Reputation: 172
Make sure you have the correct CSS and JS file linked in your document head.
<head>
<!-- STYLESHEETS //-->
<link type="text/css" rel='stylesheet' href="style/jquery.qtip.min.css">
<!-- JAVASCRIPTS //-->
<script type="text/javascript" src="scripts/jquery.qtip.min.js"></script>
</head>
Once you have those, if you add the following line into the top of eventRender function
//Add the qtip to the eventRender function:
element.qtip({ style: 'ui-tooltip-shadow ui-tooltip-jtools', content: event.description});
Like this.
eventRender: function(event, element) {
//Add the qtip to the event when renered
element.qtip({ style: 'ui-tooltip-shadow ui-tooltip-jtools', content: event.description});
Upvotes: 1
Reputation: 931
I used qTip in my fullCalendar app like this:
In eventRender:
eventRender: function(event, element) {
element.qtip({
content : [HTML SHOWING CONTENT],
position: {[position info]}
... rest of settings...
});
},
Then when i want the qTip to show (for me in eventMouseover)
eventMouseover: function(event) {
jQuery(this).qtip();
},
eventMouseout: function(event) {
jQuery(this).qtip().hide();
},
That is.. In eventRender, setup your qtip using element.qtip and in dayClick just call the $(this).qtip() function. Not sure why I did it this way, but it works :)
Upvotes: 2