Fancybox, reload previous page

Asked

Viewed 37 times

-1

I am working with the fancybox. Everything is working normally. However, I need to reload the information on the previous page, that is, on the page that has the button that calls the fancybox.

The function I use is this:

<script type="text/javascript">

            $(document).ready(function() {
                $("#popup1,#popup2").fancybox({
                    'width'             : '100%',
                    'height'            : '100%',

                    'autoScale'         : false,
                    'transitionIn'      : 'fade',
                    'transitionOut'     : 'fade',
                    'type'              : 'iframe',                        
                }); 
            });
        </script>

my button that calls is this:

<a id="popup1" href="cupomeletronico_prodrapido.php?&cod=<? echo $r[0]; ?>" class="laranja">CORRIGIR</a> 

Someone can help me?

1 answer

0

You can use the function onClosed that will reload the previous page.

<script type="text/javascript">

            $(document).ready(function() {
                $("#popup1,#popup2").fancybox({
                    'width'             : '100%',
                    'height'            : '100%',

                    'autoScale'         : false,
                    'transitionIn'      : 'fade',
                    'transitionOut'     : 'fade',
                    'type'              : 'iframe',

                    'onClosed': function() {   
                        self.location.reload(true); 
                    ;}
                }); 
            });
        </script>

About the fancybox documentation check here

  • 2

    Thank you very much. That’s exactly what I need. Thank you very much!!!!!!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.