This script randomises a quote (in this case) to only show one quote at a time, which changes on page refresh/reload.
The script goes through each <li> element in an unordered list with an id of “quotes.” If the element’s number matches the random number, it gets added a class “selected,” otherwise it gets added a class “hide.” The actual display on the page is controlled with CSS. If you check the “Source” view, you can see all the quotes are still on the page for better SEO.
Check out the demo to see the script in action.
This script is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. This script is distributed in the hope that it will be useful, but without any warranty. Let me know what you think.
Download
Credits:
Two functions in the script were taken from DOM Scripting by Jeremy Keith.
