简体   繁体   中英

codeigniter open controller in fancybox popup

I am developing a website with codeignite . I have problem with submiting forms in fancy box popups .

Consider this is original page :

http://mysite/admin/blog/posts

I want to open comments page in fancy box popup

but when I want to delete a comment in popup box , the pop up closes and original page redirects to :

http://mysite/admin/comments/delete/5

How can I submit or open links in popup without closing the popup ?

You might also try this one for ur problem:

<a id="cmid" href="comments page url">View Comments</a>

Then your fancy box javascript code as like this :

<script type="text/javascript">
    $(function(){

        $("#cmid").fancybox({
        'width'     : '50%',
        'height'    : '50%',
            'autoScale'     : false,
            'transitionIn'  : 'none',
        'transitionOut' : 'none',
        'type'      : 'iframe'
        });

    });
    </script>

Then you do delete comment. I think this won't close the pop up window.

i have similar needs to your case. When i work it out with fancybox, i set the type to ajax it will close the box. So then i realize that there is still other support. We can use the iFrame type. When you use the iFrame, the url access is proceed inside the frame. So you might want see postprocess result from deleting data, isn't it? so you should consider change to iFrame.

resource :

  1. http://fancybox.net/howto
  2. http://fancybox.net/api
  3. http://fancyapps.com/fancybox/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM