时间:2010-07-24 17:45:26

标签: jquery jquery-tools

3 个答案:

答案 0 :(得分:13)

答案 1 :(得分:2)

答案 2 :(得分:2)

现在它运作正常。对于像我这样有同样麻烦的所有人,这里是代码;)

<script type="text/javascript">
    // safe the overlay element in a global variable
    var overlayElem;

    $(document).ready(function () {
        // register the click event for ajax load and page load
        $("a[rel]").live('click', function (e) {
            e.preventDefault();

            // save overlay
            overlayElem = $(this); 

            // load overlay
            $(this).overlay({
                mask: '#3B5872',
                effect: 'apple',
                api: true,
                load: true,
                onBeforeLoad: function () {
                    var wrap = this.getOverlay().find(".contentWrap");
                    wrap.load(this.getTrigger().attr("href"));
                }
            });
        });
    });

    // send form data via ajax
    function ajaxFormRequest(form, callback, format) {
        $.ajax({
            url: form.action,
            type: form.method,
            dataType: format,
            data: $(form).serialize(),
            success: callback
        });
    }
    // close the overlay and update the table 
    function update_grid(result) {
        overlayElem.overlay().close();
        $("#gridcontainer").html(result);
    }

</script>