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
https://forums.phpfreaks.com/topic/217031-quick-how-to/
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
https://forums.phpfreaks.com/topic/217031-quick-how-to/#findComment-1128040
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.