1.

Solve : slideshow problem?

Answer»

Code: [Select]<###script language="JavaScript">
      VAR variableslide=new Array()
                        variableslide[0]=['fotos/1.JPG', '', '']
                        variableslide[1]=['fotos/2.JPG', '', '']
                        variableslide[2]=['fotos/3.JPG', '', '']
                        variableslide[3]=['fotos/4.JPG', '', '']
                        variableslide[4]=['fotos/5.JPG', '', '']
                        
      var slidewidth='450px'
      var slideheight='500px'
      var slidebgcolor='#2D2D2D'
      
      var slidedelay=3000
      
      var ie=document.all
      var dom=document.getElementById
      
      for (i=0;i<variableslide.length;i++){
      var cacheimage=new Image()
      cacheimage.src=variableslide[i][0]
      }
      
      var currentslide=0
      
      function rotateimages(){
      contentcontainer='<center>'
      if (variableslide[currentslide][1]!="")
      contentcontainer+='<a href="'+variableslide[currentslide][1]+'">'
      contentcontainer+='<img src="'+variableslide[currentslide][0]+'" border="0" vspace="3">'
      if (variableslide[currentslide][1]!="")
      contentcontainer+='</a>'
      contentcontainer+='</center>'
      if (variableslide[currentslide][2]!="")
      contentcontainer+=variableslide[currentslide][2]
      
      if (document.layers){
      crossrotateobj.document.write(contentcontainer)
      crossrotateobj.document.close()
      }
      else if (ie||dom)
      crossrotateobj.innerHTML=contentcontainer
      if (currentslide==variableslide.length-1) currentslide=0
      else currentslide++
      setTimeout("rotateimages()",slidedelay)
      }
      
      if (ie||dom)
      document.write('<div id="slidedom" style="width:'+slidewidth+';height:'+slideheight+'; background-color:'+slidebgcolor+'"></div>')
      
      function start_slider(){
      crossrotateobj=dom? document.getElementById("slidedom") : ie? document.all.slidedom : document.slidensmain.document.slidenssub
      if (document.layers)
      document.slidensmain.visibility="show"
      rotateimages()
      }
      
      if (ie||dom)
      start_slider()
      else if (document.layers)
      window.onload=start_slider
      </###script>
      <ilayer id="slidensmain" width=&{slidewidth}; height=&{slideheight}; bgColor=&{slidebgcolor}; visibility=hide>
            <layer id="slidenssub" width=&{slidewidth}; left=0 top=0>
            </layer>

      </ilayer>
this script works, but the images stay on original size

if you look in that code, you will see this

        var slidewidth='450px'
      var slideheight='500px'
      
that part should set the pic-width end heigt... are there some errors in my srcipt?





Or does someone has a script that works? ( that automaticly works..., and resize all my pic's to 450-500)

nobody?nobody AT ALL :-?Stop BUMPING your thread please.  Programming queries inevitably take longer to get a response.  You need to practise patience,Urk.  Took a while to MAKE sense of that script.  I don't LIKE it!  Do you really want all images to be displayed indiscriminately at that size, irrespective of their width:height ratio?  Why not resize all the images first?  Where did you get the script from?  Where's the rest of it?

Do you have PHP-side scripting?  (I don't remember.)  If so, you could use a PHP script that calls the GD graphics libraries to create thumbnails/resize images as you wish, on demand.i SCANNED the web and found a script that works, thx anyway



Discussion

No Comment Found