Dynamic image rotation

I consider two basic logics on the idea how to rotate images on the site.

  • Change image every time site is loaded. This logics can be realized with the simple php script.

    In this example, we just place all needed pictures to directory banner/. Script reads the list of files from the directory and converts the list to an array. Then we randomly take index of array item and show it on the page.
  • Another way is to use simple jquery plugin for rotating images.
    Here is a wonderful simple jQuery script for rotating images on site.
    We can combine previous php example and this script.

    Then get needed files from here.
    Place the following code in

    At the end of file (before ) add the following code: