Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    May 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Index It Image Slideshow

    Hello,

    What changes to the code do I have to make to get the slideshow to start with 1 instead of a 0 without producing javascript errors? Thanks in advance.

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    How do we know what to change if we don't see any code at all?
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #3
    Banned
    Join Date
    May 2006
    Location
    England
    Posts
    664
    Thanks
    0
    Thanked 84 Times in 84 Posts
    Quote Originally Posted by glenngv View Post
    How do we know what to change if we don't see any code at all?
    It seems to be another javascriptkit abortion. It only creates about 12 global objects, relies on innerHTML and creates links that use the javascript: pseudo protocol.

  • #4
    New to the CF scene
    Join Date
    May 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    http://www.javascriptkit.com/script/.../indexit.shtml

    Code:
    <style type="text/css">
    
    #slideshowContainer{
    width: 300px;
    height: auto;
    }
    
    #numberDiv a{
    font: bold 14px Arial;
    text-decoration: none;
    }
    
    #backforthbuttons{
    margin-top: 6px;
    }
    
    </style>
    
    <script type="text/javascript">
    
    // Index It Image Slideshow script- By JavaScriptKit.com
    // For this and over 400+ free scripts, visit JavaScript Kit- http://www.javascriptkit.com/
    // This notice must stay intact for use
    
    //Specify images for slideshow:
    //["Image Path", "Optional Image link"]
    
    var numberslide=new Array()
    numberslide[0]=["plane1.gif", "http://www.google.com"]
    numberslide[1]=["plane2.gif", ""]
    numberslide[2]=["plane3.gif", ""]
    numberslide[3]=["plane4.gif", ""]
    numberslide[4]=["plane5.gif", ""]
    
    var mylinktarget="" //specify optional link target
    var mylinkcolor="navy" //specify default color of number links
    var mylinkcolorSelected="red" //specify color of selected links
    
    var imgborderwidth=0 //specify border of image slideshow
    
    /////Stop customizing here////////////////
    
    var preloadit=new Array()
    for (i=0;i<numberslide.length;i++){
    preloadit[i]=new Image()
    preloadit[i].src=numberslide[i][0]
    }
    
    var currentindex=""
    
    function changeslides(which){
    var imghtml=""
    currentindex=(which=="initial")? 0 : parseInt(which)
    var mode=(which=="initial")? "initial" : ""
    var which=(mode=="initial")? numberslide[0] : numberslide[which]
    if (which[1]!="")
    imghtml='<a href="'+which[1]+'" target="'+mylinktarget+'">'
    imghtml+='<img src="'+which[0]+'" border="'+imgborderwidth+'">'
    if (which[1]!="")
    imghtml+='</a>'
    
    if (mode=="initial")
    document.write('<div>'+imghtml+'</div>')
    else{
    document.getElementById("imagecontainer").innerHTML=imghtml
    changecolors()
    }
    }
    
    function createnumbers(){
    document.write('<a href="javascript:changeslides(0)" style="color:'+mylinkcolorSelected+'">0</a> ')
    for (i=1; i< numberslide.length; i++)
    document.write('<a href="javascript:changeslides(\''+i+'\')">'+i+'</a> ')
    }
    
    function changecolors(){
    var numberobj=document.getElementById("numberDiv")
    numberlinks=numberobj.getElementsByTagName("A")
    for (i=0; i<=currentindex; i++)
    numberlinks[i].style.color=mylinkcolorSelected
    for (i=currentindex+1; i<numberslide.length; i++)
    numberlinks[i].style.color=mylinkcolor
    }
    
    function goforward(){
    if (currentindex<numberslide.length-1)
    changeslides(currentindex+1)
    }
    
    function goback(){
    if (currentindex!=0)
    changeslides(currentindex-1)
    }
    
    </script>
    Code:
    <div id="slideshowContainer">
    
    <div id="imagecontainer">
    <script type="text/javascript">
    changeslides("initial") //This call displays the first image
    </script>
    </div>
    
    <div id="numberDiv">
    <script type="text/javascript">
    createnumbers() //This call writes out the numbers
    </script>
    </div>
    
    <div id="backforthbuttons">
    <a href="javascript:goforward()" style="float: right"><img src="blueright.gif" border="0"></a> <a href="javascript:goback()"><img src="blueleft.gif" border="0"></a>
    </div>
    
    <p style="font: normal 11px Arial">This free script provided by<br>
    <a href="http://www.javascriptkit.com">JavaScript Kit</a></p>
    
    </div>


  •  

    Posting Permissions

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