www.webdeveloper.com
Results 1 to 2 of 2

Thread: javascript code for text slideshow

  1. #1
    Join Date
    Oct 2012
    Posts
    1

    javascript code for text slideshow

    Hi I am posting a javascript code for text slideshow. The problem in this code is it is generating the slideshow in a random manner. But I want the slides to display in the specified manner. The trick lies in the line a=Math.floor(Math.random()*quotations.length), I hope. But I dont know how. Please help.

    <SCRIPT type="text/javascript">

    var quotations = new Array()

    quotations[0]= "1. Iron pnictides RFe<sub>2</sub>As<sub>2</sub>(R = Ca, Sr, Eu etc.)."

    quotations[1]= "2. Iron Chalcogenides Fe(TeSe)."

    quotations[2]= "3. Topological insulators."

    quotations[3]= "4. Surface and interface states."

    quotations[4]= "5. Diluted magnetic semiconductors."

    quotations[5]= "6. Quantum wells."

    function display()

    {

    a=Math.floor(Math.random()*quotations.length)

    document.getElementById('textslide').innerHTML=quotations[a]
    document.getElementById('textslide').style.color = 'red';
    document.getElementById('textslide').style.fontWeight="bold";



    setTimeout("display()",1000)

    }
    </script>

    Regards,
    rocky

  2. #2
    Join Date
    Oct 2010
    Location
    Versailles, France
    Posts
    1,264

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles