datepick plugin - text and date in div but not dialog box
The following js/jquery places the expected text in the dialog div - but it shows as plain text not within a dialog box. The date picker is keith woods excellent date picker.
As each date is hovered over the correct date is picked up e.g sample output is " I am currently not in a dialog wed 17-oct-2012" - it's just not in a dialog!?
- <script type="text/javascript">
- $(document).ready(function() {
- $('#hoverPicker').datepick({
- onShow: $.datepick.hoverCallback(showDialog),
- dateFormat: 'D dd-mm-yyyy',
- showTrigger: '#calImg'});
- });
-
- function showDialog(date, selectable) {
- var eventid = "test";
- $('#dialog').attr('title', "test title");
-
- // put the date in the dialog box
- $("#dialog").html("I am currently not in a dialog " + (selectable ? $.datepick.formatDate('D dd-M-yyyy', date) : '') || 'nothing');
- // show the dialog box
- $('#dialog').dialog('open');
- };
- </script>
html is:
- <pre><div id="dialog"></div></pre>
which looked at in Firebug shows:
- <pre>
- <div id="dialog" title="test title">I·am·currently·not·in·a·dialog··wed 17-oct-2012</div>
- </pre>
And the head elements are:
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
- <script type="text/javascript" src="http://www.zzz.co.uk/admin02/jqdp406kw/jquery.datepick.js"></script>
- <script type="text/javascript" src="http://www.zzz.co.uk/admin02/jqdp406kw/jquery.datepick.ext.js"></script>