Good all the time of day. First, what I have:

<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1251"> <script type="text/javascript"> NewImg = new Array("image1.jpg", "image2.jpg", "image3.jpg", "image4.jpg"); var ImgNum = 0; var ImgLength = NewImg.length - 1; var delay = 5000; var lock = false; var run; function chgImg(direction) { if (document.images) { ImgNum = ImgNum + direction; if (ImgNum > ImgLength) { ImgNum = 0; } if (ImgNum < 0) { ImgNum = ImgLength; } document.slideshow.src = NewImg[ImgNum]; } } function auto() { if (lock == true) { lock = false; window.clearInterval(run); } else if (lock == false) { lock = true; run = setInterval("chgImg(1)", delay); } } </script> </head> <body> <table id="table1"> <tr> <td colspan="3"> <img src="image1.jpg" name="slideshow"> <br> <br> </td> </tr> <tr> <td> <a href="javascript:chgImg(-1)"> Back</a> </td> <td> <a href="javascript:auto()"> Play / Stop</a> </td> <td> <a href="javascript:chgImg(1)"> Next</a> </td> </tr> </table> </body> </html> 

In this code, there are several pictures that alternately alternate. Actually it works perfectly, but the hunt is bigger.

  1. Tell me how to do it, what would change not the picture, but the written code? Let's say a couple of words and a picture. Or the whole table?
  2. Is it possible in some way to do, in the place of a simple shift, the possibility of appearance and disappearance (or turning over), so to speak, for the code that is indicated in p1? (Naturally with the possibility of on or off. This effect.)

PS I, of course, can google on a slideshow, but I'm interested in, so to speak, the "kosher" option, in a good sense of the word. eight-)

    1 answer 1

    To make the contents of the tag do this:

     <div id="txt"> Π‘Ρ‚Π°Ρ€ΠΎΠ΅ содСрТимоС <div> <script> var txt1=document.getElementById("txt1"); txt1.innerHTML="НовоС содСрТимоС"; </script> 

    And to make a smooth attenuation / appearance, you need to change the opacity