Request: Text rotator using CSS?

Discussion in 'CSS' started by sarathy, Nov 2, 2007.

  1. #1
    sarathy, Nov 2, 2007 IP
  2. webdesigner

    webdesigner Well-Known Member

    Messages:
    489
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    110
    #2
    CSS = Cascading Style Sheets. There for styling of your markup. Which means you cant do anything like that in CSS.

    If you dont want to use Javascript rotater, try a PHP or ASP version depending on which type of server you are on.
     
    webdesigner, Nov 2, 2007 IP
  3. sarathy

    sarathy Peon

    Messages:
    1,613
    Likes Received:
    76
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks for the info,
    Can it be done through PHP ?, or do you have a script for that?,
     
    sarathy, Nov 2, 2007 IP
  4. liquidkiddie

    liquidkiddie Banned

    Messages:
    149
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #4
    It certainly can be done through PHP. If you have wordpress, there's a bunch of these sorts of plugins available. I'd have a look and adapt, or have a look at http://www.hotscripts.com
     
    liquidkiddie, Nov 2, 2007 IP
  5. liquidkiddie

    liquidkiddie Banned

    Messages:
    149
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #5
    liquidkiddie, Nov 2, 2007 IP
    sarathy likes this.
  6. webdesigner

    webdesigner Well-Known Member

    Messages:
    489
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    110
    #6
    I use this in one of my sites and works fine.

    
    <?
    $random = rand(0, 2);
    
    if ($random == "0") {
    include ("/home/***/public_html/file1.php");}
    
    if ($random == "1") {
    include ("/home/***/public_html/file2.php");}
    
    if ($random == "2") {
    include ("/home/***/public_html/file3.php");}
    ?>
    
    Code (markup):
    In this script, PHP will pick a number at random between 0 and 2 (so could be 0, 1 or 2). Depending on what it picks it includes the corresponding file. Nice and simple.
     
    webdesigner, Nov 2, 2007 IP