Jump to content

Quick How To


herghost

Recommended Posts

Hi everyone,

 

I have been looking for a script that I just cant seem to find, basically when a user registers I want to return them to the index page, which is as far as ive got. (php)

 

What I want to happen on the index page when they get back is a bar to appear, full width of the screen and about 60px high, with a message letting them know they have registered and been logged in, then for it to fade and dissapear in about 5 seconds.

 

Is it js that I would use for something like this? Does anyone have any links to examples or tuturials?

 

Many thanks

 

 

Link to comment
Share on other sites

You'd use some form of flag (most likely a parameter passed within the URL), to tell the PHP to display the banner originally.. Then yeah you'd need to use JavaScript for the fade effect. This is extremely easy to do with jQuery:

 

<script type="text/javascript" src="/path/to/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function() {
    $('#elementID').delay(5000).fadeOut();
});
</script>

http://api.jquery.com/delay/

http://api.jquery.com/fadeOut/

 

It does mean you'd need to include the jQuery framework, but it's only 26k and saves you the cross-browser headaches. If you'd rather not use jQuery, this tutorial may help:

 

http://www.switchonthecode.com/tutorials/javascript-tutorial-simple-fade-animation

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.