开发者

How to fire a anchor to a fancybox?

I have a function that used to get all the checked item and join it with separated "," into a data table.

function funcSelect(x){
    var selectedItems = new Array();
    var selectedItemsName = new Array();

    $("table tbody input[@name]:checked").each(function(){
        selectedItemsName.push($(this).attr('id'));
        selectedItems.push($(this).attr('id')+"/"+$(this).attr('value'));

    });

    if (selectedItems.length == 0){
        alert("No item selected!");
    } else {
        var getjoinData = selectedItems.join(',');
        //alert('archive.htm?d='+selectedItemsName+'&f='+getjoinData);
        $('.xlink').fancybox({ // No idea });
        ....
    }
}

and i want to fire the开发者_C百科 link (archive.htm?d='+selectedItemsName+'&f='+getjoinData) to fancybox to open. I have an iframe type setting for fancybox. How can I do this? please help..=(


If I understood correctly you want to load into a fancybox aresponse of the ajax request from the link you create. If so you should be able to do a manual call feeding the content to display from the ajax response. Place this call in e.g. succes callback of $.ajax:

 $.fancybox('content': 'your parsed or not ajax response',
            'type':'iframe',
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜