2011-10-11 111 views

回答

0

我可以想到這樣做的一種方法。

  • 您通過ajax提交表單,並在「成功」回調函數中觸發fancybox打開。

使用jQuery你可以做這樣的事情。

$(function(){ 
    $("#id_of_form").submit(function(e){ 
    e.preventDefault(); 

    var req = $.ajax({ 
     type: 'POST', 
     url: $(this).attr("action"), 
     data: $(this).serialize(), 
     dataType: "json" 
    }); 

    req.success(function(resp){ 
    //resp is data back from server 
     //Here you write logic for opening the fancybox iframe    
    }); 

    }); 

}); 

希望這會有所幫助。

+0

剛剛找到smth。喜歡這個。謝謝。 – lvil