How to reload a page with load.gif?

0

Expensive, how do I reload the page so it does not flicker? Can I leave a GIF on the screen while the page is being reloaded?

    $('#objetivos-form').live('submit',function(){

        var form = $(this);
        // validando
        if (             
            form.find('input[name="objetivo[]"]:checked').val() == '' ||        
            form.find('input[name="objetivo[]"]:checked').val() == null      
        ){
            message.erro('Escolha um objetivo!', '#result');                

        } else {

            $.post( form.attr('action'), form.serialize(), function(result){
                $(".descubra-objetivo").fadeOut();                   
                // location.reload();

                $(".descubra-alterar").fadeIn();
            });
        }    
        return false; 
    });
    
asked by anonymous 02.06.2014 / 19:18

2 answers

1

Hello, I suggest you follow this tutorial, even if it is in English, it is very enlightening, follow the link .: link

    
02.06.2014 / 19:57
1

The only way to ensure that a page does not blink or show-and-hide content (because of javascript not being immediate) is via CSS.

All content that will be changed by CSS "immediately", that is in onLoad or DOMready of the page has no other way to guarantee behavior than via CSS.

So the suggestion is to have display: none , visibility: hidden , or opacity: 0 and change via javascript when the page opens.

In addition to what I wrote above, any changes you make to a page (on the client side) are all lost when the page loads again.

    
02.06.2014 / 19:21