How can I add a fade event to my simple javascript image array? -
i have simple image array website : javascript code triggered links in html.
the javascript working fine can't seem images in fadein when image switches. switch abrupt painful eyes.
could please explain how might fadein event or effect going image array?
here javascript:
var image = new array("one.jpg","two.jpg","three.jpg","four.jpg");
var image_number = 0; var image_length = image.length - 1;
function change_image(num){
image_number = image_number + num; if (image_number>image_length){ image_number = 0; } if (image_number<0){ image_number = image_length; } if (image_number>0){ function fade_in () { $("image_number") .fadein(); } document.my_imagearray.src= image[image_number]; return false; }
and html:
seems forgot add html code
from code have provided, can assume should write this:
if ( image_number > 0 ) { $("html_item_that_contains_image").fadeout(); document.my_imagearray.src = image[image_number]; $("html_item_that_contains_image").fadein(); }
Comments
Post a Comment