Change Image with transition effects

Posted by Goro on Stack Overflow See other posts from Stack Overflow or by Goro
Published on 2010-04-09T21:54:21Z Indexed on 2010/04/09 22:03 UTC
Read the original article Hit count: 338

Hello,

I have the following script that changes my image on a timer:

var da = setInterval( function() {

    var current_image = document.getElementById('node_picture').src;
    var image_index = current_image.substring(48,49);
    image_index++;

    if (image_index > 4) {
        image_index = 1;
    }

    document.getElementById('node_picture').src="img/node/<?php echo $node_id ?>/" + image_index + ".png";

}, 4000);

I am trying to add a jQuery FadeIn() effect. I tried to add

$('node_picture').FadeIn();

but that does not work.

Thanks,

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about web-development