-2

I have this code:

<script type="text/javascript">
    var aImages = [ 
        "images/gaming/GTAV/GTAVReviewImage1.jpg",  
        "images/gaming/GTAV/GTAVReviewImage2.jpg",
        "images/gaming/GTAV/GTAVReviewImage3.jpg",
        "images/gaming/GTAV/GTAVReviewImage4.jpg",
        "images/gaming/GTAV/GTAVReviewImage5.jpg",
        "images/gaming/GTAV/GTAVReviewImage6.jpg",
        "images/gaming/GTAV/GTAVReviewImage7.jpg"];
    var oImage   =  null;  
    var iIdx     =  0;  
    function play() {
        try {
        if (oImage===null) { oImage=window.document.getElementById("review-images"); }
        oImage.src  =  aImages[(++iIdx)%(aImages.length)];  
        setTimeout('play()',5000);  
        } catch(oEx) {
    }
}
</script>

which changes the image on this page: http://chrisbrighton.co.uk/GTAV.php every five seconds.

How can I add image transition to it?

UPDATE: When I add -webkit-transition to the img tag nothing happens.

Thanks.

Chris
  • 2,106
  • 4
  • 16
  • 17

1 Answers1

0

There are different ways to do it. A lot of people have went to CSS3 now that there is some really cool animating and transition effects... You can control your ccs3 effects using javascript. For a detailed tutorial check - controlling animations with javascript

JayD
  • 6,173
  • 4
  • 20
  • 24