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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.