AndrewSmith Posted January 24, 2013 Share Posted January 24, 2013 I am having trouble with finding a way to add a fadding effect to my cycling banner. I was wondering if anyone knew what to add to the following script. <script>imgArray = new Array(4);imgArray[0] = new Image;imgArray[0].src = "epicgamer.jpg";imgArray[1] = new Image;imgArray[1].src = "atv.jpg";imgArray[2] = new Image;imgArray[2].src = "awar.jpg";imgArray[3] = new Image;imgArray[3].src = "banana.jpg";imgArray[4] = new Image;imgArray[4].src = "war.jpg";imgArray[5] = new Image;imgArray[5].src = "bird.jpg";imgArray[6] = new Image;imgArray[6].src = "cannon.jpg";imgArray[7] = new Image;imgArray[7].src = "cross.jpg";imgArray[8] = new Image;imgArray[8].src = "dragracer.jpg";imgArray[9] = new Image;imgArray[9].src = "escape.jpg";imgArray[10] = new Image;imgArray[10].src = "face.jpg";imgArray[11] = new Image;imgArray[11].src = "game.jpg";imgArray[12] = new Image;imgArray[12].src = "goal.jpg";imgArray[13] = new Image;imgArray[13].src = "happy.jpg";imgArray[14] = new Image;imgArray[14].src = "hgame.jpg";imgArray[15] = new Image;imgArray[15].src = "hocky.jpg";imgArray[16] = new Image;imgArray[16].src = "logix.jpg";imgArray[17] = new Image;imgArray[17].src = "mania.jpg";imgArray[18] = new Image;imgArray[18].src = "math.jpg";imgArray[19] = new Image;imgArray[19].src = "maze.jpg";imgArray[20] = new Image;imgArray[20].src = "ngame.jpg";index = 0; function cycle() {document.banner.src = imgArray[index].src;index++;if (index == 21){index = 0;}setTimeout("cycle()", 2000);return;}</script>All I want it to do is fade out of one image and into the next within one second.Thanks in advance. Link to comment Share on other sites More sharing options...
davej Posted January 24, 2013 Share Posted January 24, 2013 (edited) Uh, you say Java but you mean JS. Very different. document.getElementById('image1').style.opacity = 50/100;document.getElementById('image1').style.filter = 'alpha(opacity=' + 50 + ')'; Edited January 24, 2013 by davej Link to comment Share on other sites More sharing options...
AndrewSmith Posted February 22, 2013 Author Share Posted February 22, 2013 thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now