I have never used jQuery before, and I would like to ask how to do something that might seem simple to you. I looked around, but could not find the answer.
Ok, let's say I have an HTML document,
<html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> </head> <body> <h1>Hello world!</h1> <p>Here is a message: <span id="message"></span></p> </body> </html>
I want to ask how to create a list of lines, and when the page loads, the first one is displayed, and after a random interval of the specified time, it changes to the next, etc., and maybe 5 later, it redirects the user to another page.
If my posts were:
Hello! This is a website! You are now going to be redirected. Are you ready? You're now being redirected...
In my real site, it would be nice if the messages could be hidden from the user (on the page, but in the css / js file it would be good) and that he had a good look of the fading effect, like the next message came.
Can someone explain to me how this works?
I would just like to add, I have no experience in jQuery (just a little in JavaScript), and I have no idea where the scripts / functions go. Can someone show me how or a link to a beginner's guide that shows me this?
source share