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,471
There are 916 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     Javascript :

Shorter code?

Thread title: Shorter code?
Closed Thread    
    Thread tools Search this thread Display Modes  
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

08-04-2008, 07:12 PM
#2
AlexWind is offline AlexWind
Status: Member
Join date: Apr 2008
Location: Florida
Expertise:
Software:
 
Posts: 144
iTrader: 4 / 100%
 

AlexWind is on a distinguished road

Send a message via AIM to AlexWind Send a message via MSN to AlexWind Send a message via Yahoo to AlexWind

  Old

use Jquery instead.

08-04-2008, 09:25 PM
#3
Gaz is offline Gaz
Gaz's Avatar
Status: Request a custom title
Join date: Apr 2007
Location: UK
Expertise: Code & Programming
Software: Coda, TextMate, Sublime 2
 
Posts: 2,097
iTrader: 26 / 100%
 

Gaz will become famous soon enough Gaz will become famous soon enough

Send a message via Skype™ to Gaz

  Old

http://malsup.com/jquery/cycle/

Eg.

$('#s5').cycle({
fx: 'fade',
pause: 1
});

08-04-2008, 10:15 PM
#4
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

Originally Posted by GarethP View Post
http://malsup.com/jquery/cycle/

Eg.

$('#s5').cycle({
fx: 'fade',
pause: 1
});

That looks a bit complicated, the fade demo is really nice though. I'm not sure how to install it.

08-04-2008, 10:39 PM
#5
Gaz is offline Gaz
Gaz's Avatar
Status: Request a custom title
Join date: Apr 2007
Location: UK
Expertise: Code & Programming
Software: Coda, TextMate, Sublime 2
 
Posts: 2,097
iTrader: 26 / 100%
 

Gaz will become famous soon enough Gaz will become famous soon enough

Send a message via Skype™ to Gaz

  Old

Add me to MSN and I'll help ya through it.

08-04-2008, 11:09 PM
#6
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

Originally Posted by GarethP View Post
Add me to MSN and I'll help ya through it.
Much appreciated

Closed Thread    


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

  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