0

I have a calendar code that contains a table with the td for days of the month as follows:

<td class="event">
<div class="eventList" title="Events For Today">
<ul>
    <li>Event 1</li>
    <li>Event 2</li>
</ul>
<br />
<a class="anEvent" href="#">[myDateHere]</a>
</div>
</td>

*[myDate] refers to the day of the month...

At the bottom of my page there is some jquery as follows:

* --dialog for calendar events-- */
$('.eventList').dialog({
    autoOpen: false,
    closeOnEscape: true
});

$('.anEvent').click(function(){
    $('.eventList').dialog("open");
});

At the moment, when the date is clicked it will open all instances of dialogs created (Which is not my aim), is there a way to select only the div of the clicked link to be opened??

Thanks for reading.

1
Contributor
1
Reply
3
Views
5 Years
Discussion Span
Last Post by soUPERMan
0

Well, i went experimenting and my solution was to include the date as an id for the div like this:

    <td class="event">
    <div id="[myDateHere]" class="eventList" title="Events For Today">
    <ul>
    <li>Event 1</li>
    <li>Event 2</li>
    </ul>
    <br />
    <a class="anEvent" href="#">[myDateHere]</a>
    </div>
    </td>

Then call the dialog with this:

$('.anEvent').click(function(){
    var day = $(this).text();
    $('#'+day).dialog('open');
});

Now to do the happy dance.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.