Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,472
There are 1440 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     Javascript :

Shorter code?

Thread title: Shorter code?
     
    Thread tools Search this thread Display Modes  
Prev Previous Post   Next Post Next
08-04-2008, 04:17 PM
#1
Lustre91 is offline Lustre91
Status: Member
Join date: Oct 2007
Location: UK
Expertise:
Software:
 
Posts: 491
iTrader: 0 / 0%
 

Lustre91 is on a distinguished road

Send a message via MSN to Lustre91

  Old  Shorter code?

I found a slide show code on Dynamic Drive, however it's quite long, I've shorted it down myself a little bit, but I was wondering if there was a smaller code that did the exact same thing? Here's the code I'm using now...

Code:
<script language="JavaScript1.2">

var variableslide=new Array()

variableslide[0]=['1.png', 'http://www.divaexpose.com/wwe-divas-nude.html', '']
variableslide[1]=['2.png', 'http://www.divaexpose.com/wwe-divas-nude.html', '']
variableslide[2]=['3.png', 'http://www.divaexpose.com/wwe-divas-nude.html', '']
variableslide[3]=['4.png', 'http://www.divaexpose.com/wwe-divas-nude.html', '']

var slidewidth='130px' //set to width of LARGEST image in your slideshow
var slideheight='160px' //set to height of LARGEST iamge in your slideshow, plus any text description
var slidebgcolor='#070707'

var slidedelay=2000

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>
I'm using it on my WWE Divas site. You can probably see the slide show straight away. Any help would be appreciated

     


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed