完整日历+ jquery ui对话

时间:2012-07-30 02:59:47

标签: php javascript jquery-ui

我正在使用fullcalendar: - http://arshaw.com/fullcalendar/

我正在使用jquery .post将参数返回到同一页面以生成一些结果,这很有效。

同时,我希望使用jquery ui对话来保存显示的内容。从官方网站粘贴示例代码时,该示例有效。但是,在将.post输出与对话组合时,它并没有成功。

我想在下面两组脚本的组合中寻求帮助: -

//用于生成.post输出(工作!)

<script>
function event_details(thevalue){
$.post('module/calendar/event_details.php',{
eid:thevalue},

function(output){
    $('#theeventmsg').html(output);
});
}
</script>
<div id='theeventmsg'></div>

// jquery ui对话(工作!)

<script>
// increase the default animation speed to exaggerate the effect
$.fx.speeds._default = 1000;
$(function() {
    $( "#dialog" ).dialog({
        autoOpen: true,
        show: "blind",
        hide: "explode"
    });

    $( "#opener" ).click(function() {
        $( "#dialog" ).dialog( "open" );
        return false;
    });
});
</script>



<div class="demo">
<div id="dialog" title="Basic dialog">
    <p>This is an animated dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
</div>
<button id="opener">Open Dialog</button>
</div><!-- End demo -->

可以帮忙???非常感谢!!

1 个答案:

答案 0 :(得分:0)

尝试这样的事情:

<script>
  $.fx.speeds._default = 1000;

  $(document).ready(function() {
    $( "#dialog" ).dialog({ autoOpen: false });

    $('#button').click(function () {
      var data = { ... };

      $.post('module/calendar/event_details.php', data, function (output) {
        $('#dialog p').html(output);
        $( "#dialog" ).dialog("open");
      });
    });
  });
</script>    

<div id="dialog">
  <p>content</p>
</div>

<button id="button">button</button>

或者:

<script>
  $(document).ready(function () {
    function eventdetail(thevalue) {
      $.post('event_details.php', { eid: thevalue }, function (output) {
        $('#dialog p').html(output);
        $("#dialog").dialog({ autoOpen: true });
      });
    }

    $('#button').click(function () { eventdetail('value'); });
  });  
</script>

<div id="dialog">
  <p>content</p>
</div>

<button id="button">button</button>
相关问题