JS Help please

Permabanned
Joined
22 Apr 2007
Posts
1,805
Hi, I have this JS which roates 7 images every 3 seconds which works nicely as it fades in to the next image.

I'd like to alter the JS so that all the images are black and white but when the mouse goes over them they change to colour. The images are not links.

Also, when the mouse moves off I'd like it to go back to b&w.

Code:
<!--
var slideShowSpeed = 3000

// Duration of crossfade (seconds)
var crossFadeDuration = 3

// Specify the image files
var Pic = new Array() 

Pic[0] = 'images/img1.jpg'
Pic[1] = 'images/img2.jpg'
Pic[2] = 'images/img3.jpg'
Pic[3] = 'images/img4.jpg'
Pic[4] = 'images/img5.jpg'
Pic[5] = 'images/img6.jpg'
Pic[6] = 'images/img7.jpg'

// =======================================
// 
// =======================================

var t
var j = 1
var p = Pic.length

var preLoad = new Array()
for (i = 0; i < p; i++){
   preLoad[i] = new Image()
   preLoad[i].src = Pic[i]
}

function runSlideShow(){
   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)"
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShow.filters.blendTrans.Apply()      
   }
   document.images.SlideShow.src = preLoad[j].src
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play()
   }
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}
//-->

Can someone help?

I understand I need a total of 14 images, 7 b&w and 7 colour but I don't know how to fit them in to the code above
 
Can you not have 2 copys of the image, one in black and white and the other in colour and use onmouseover? Or is this not practical. I've been doing some looking on google and I can't find anything.

P.S. Give people a chance to reply ;)
 
Jaffa_Cake said:
Can you not have 2 copys of the image, one in black and white and the other in colour and use onmouseover? Or is this not practical. I've been doing some looking on google and I can't find anything.

P.S. Give people a chance to reply ;)
Yeah, onmouse over is fine and the two images of each is what I was getting at. How do I add this in to the above JS though.

24 hours and one reply. Should I leave it longer?
 
Back
Top Bottom