Tuesday, January 17, 2006

Timed Recursive Function : Java Script

//
// function that executes recursively but it is timed.
//
function animate() {
    k++
    if (k == 5) k = 1
    document.images[k - 1].src = imgArray2[k - 1].src
    if (k > 1)
        document.images[k - 2].src = imgArray1[k - 2].src
    else
        document.images[3].src = imgArray1[3].src
    var timeOutID = setTimeout("animate()", 1000)
} 

2 comments:

Mike said...

Nice Blog :)


www.FriendsterForum.com

Chinthaka Kumarasiri said...
This comment has been removed by a blog administrator.

iPhone Launch Screen Sizes

iPhone Portrait iOS 8 Retina HT 5.5 = 1242 X 2208 Retna HD 4.7 = 750 X 1134 iPhone Landscape iOS 8 Retina HD 5.5  2208 X 1242 iPho...