make a clickable tooltip with eventurl
-
Hi,
I’m trying to create a tooltip with a clickable anchor tag to the event that is taking place at that specific date.
I’m using jQuery tooltip widget for this.
So for I’ve got the tooltip working but I can’t echo the link-url to the calendar-small template I’m using.Here’s the JS:
function setClickableTooltip(target, content) { $(target).tooltip({ show: null, position: {my: "center top", at: "center bottom"}, content: content, hide: {effect: ""}, close: function(event, ui){ ui.tooltip.hover( function () { $(this).stop(true).fadeTo(400, 1); }, function () { $(this).fadeOut("400", function(){ $(this).remove(); }); } ); } }); } setClickableTooltip( '.eventful', '<a href="#_EVENTURL">Event Name</a>' );
And the php template (calendar-small)
<tr> <?php $cal_count = count($calendar['cells']); $col_count = $count = 1; $col_max = count($calendar['row_headers']); foreach($calendar['cells'] as $date => $cell_data ){ $class = ( !empty($cell_data['events']) && count($cell_data['events']) > 0 ) ? 'eventful':'eventless'; if(!empty($cell_data['type'])){ $class .= "-".$cell_data['type']; } ?> <td class="<?php echo $class; ?>" title="<?php echo esc_attr($cell_data['link_title']); ?>"> <?php if( !empty($cell_data['events']) && count($cell_data['events']) > 0 ): ?> <?php echo date('j',$cell_data['date']); ?> <?php else:?> <?php echo date('j',$cell_data['date']); ?> <?php endif; ?> </td> <?php $col_count= ($col_count == $col_max ) ? 1 : $col_count+1; echo ($col_count == 1 && $count < $cal_count) ? '</tr><tr>':''; $count ++; } ?> </tr>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘make a clickable tooltip with eventurl’ is closed to new replies.