SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Jun 2004
    Location
    U.S.
    Posts
    258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    swapping images each time once the site loaded

    Can someone tell me where can I get some javascripts for swapping images every time once users visit my website like Yahoo home page? Thanks alots.

  2. #2
    do righteous deeds
    Join Date
    Aug 2006
    Location
    Türkiye Turkey تركيى
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    <html><head>
    <script type="text/javascript" language="Javascript" >
    resim=new Array(
    "saat.bmp",
    "cicek.bmp",
    "KUMANDA.bmp"
    );

    function degis(){
    var a =document.getElementById("ad") ;
    a.style.backgroundImage="url("+resim[Math.floor(Math.random()*resim.length)]+")";

    //setTimeout("degis()",5000)
    }

    window.onload=degis;
    </script>
    </head>
    <body id="ad">

    </body>
    </html>



    <script>
    <!--

    var resim1="ev.bmp"
    var resim2="saat.bmp"
    var resim3="KUMANDA.bmp"
    var resim4="agac.bmp"
    var resim5="cicek.bmp"
    var resim6="tablo1.bmp"
    var resim7="tablo2.bmp"
    var resim8="ev2.bmp"
    var resim9="akasya.jpg"
    var resim10="kupZeka.bmp"
    var x=Math.round(Math.random()*9)
    if (x==0) x=resim1
    else if (x==1) x=resim2
    else if (x==2) x=resim3
    else if (x==3) x=resim4
    else if (x==4) x=resim5
    else if (x==5) x=resim6
    else if (x==6) x=resim7
    else if (x==7) x=resim8
    else if (x==8) x=resim9
    else x=resim10

    document.write('<img src='+'"'+x+'"'+' >')

    //-->
    </script>


Bookmarks

Posting Permissions

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