Jump to content

Looking for a fade out after success message from page


gary4u

Recommended Posts

Hi,

Looking for a fade out after success message from page. I am using this code to place a Success message , now I want this message to fade after "submit Success" .

Can any please help me out.

This is the code in the php

function formSuccess(){
$("#contactForm")[0].reset();
submitMSG(true, "Message Submitted!")
}

I need this message- "Message Submitted!"  to fade after showing on the page.

 


Thanks

Link to comment
Share on other sites

Thanks. If I had to come across this news earlier I would have used it .But the Website structure is mostly done and the contact page is working fine with the message display on the page.and I do not want to disturb it by changing the whole setup. I just want to add this extra code to the after submit message. I am just looking for this small help to complete it. It is the tail end of the website.

Link to comment
Share on other sites

You didn't mention that you were doing some kind of ajax output.  I now see the jscript code which I don't follow.  I assumed that your message was part of the initial display of your page output so this would be perfect there.

Try googling some more yourself.  Good luck.

Link to comment
Share on other sites

You can do with an animated SVG image also

function fadingMessage($messageToDisplay)
{
        $msg = <<<MSG
            <svg width=800 height=80 viewBox="0 0 800 80">
            <style type='text/css'>
                .msg {
                    font-family: verdana, sans-serif;
                    font-size: 36pt;
                    fill: #8F1FCF;
                }
            </style>
            <text class="msg" x=0 y=70 >$messageToDisplay</text>
            <animate attributeName="opacity" from="1" to="0" begin="1s" dur="3s" fill="freeze" />
        </svg>
MSG;
        return $msg;
}

echo  fadingMessage("This text will just fade away")

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.