herghost Posted October 27, 2010 Share Posted October 27, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/217031-quick-how-to/ Share on other sites More sharing options...
Adam Posted October 29, 2010 Share Posted October 29, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/217031-quick-how-to/#findComment-1128040 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.