comment puis-je modifier le script ci dessous (extrait), pour pouvoir afficher des "messages" successifs de plus d'une ligne sans avoir à ajouter <br> à chaque retour de ligne (je souhaite utiliser des textes mis en forme dans Word)???
<!-- Begin var background = "black"; var text = "white"; var URL = "textslideshow.htm"; // change this to the page you want to go to after the slideshow finishes var speed = 4000; // time in milliseconds (4000 = 4 secs) var msgcount = 5;
var i = 1; var blank = " ";
function StringArray (n) { this.length = n; for (var x = 1; x <= n; x++) { this
= ' '; } }
message = new StringArray(msgcount); // Change the following lines to your own message. message[1] = "Check out this JavaScript Slideshow!!"; message[2] = "Yet another cool effect that..."; message[3] = "you can easily add to your web pages."; message[4] = "Why don't you put it on your site?"; message[5] = "Don't forget, there are still<br>lots more scripts to check out!";
voici d'abord le code complet (à peu près ce que je veux, sauf que je veux plusieurs lignes de texte) Mais je ne veux pas être obligé d'ajouter une balise <br> à chaque retour de ligne (j'ai des textes assez longs)...
Peut-être que je devrais essayer un autre code (qui ouvirait chacun de mes textes .txt dans la même page, à intervalles réguliers, comme s'il s'agissait d'un diaporama foto???)
Code:
<html> <head> <title>Text Slideshow</title> <script language="JavaScript" type="text/javascript"> <!-- This script and many more are available free online at --> <!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin // change the colours below if required var background = "black"; var text = "white"; var URL = "textslideshow.htm"; // change this to the page you want to go to after the slideshow finishes var speed = 4000; // time in milliseconds (4000 = 4 secs) var msgcount = 5; // change this to the number of lines in your own message
var i = 1; var blank = " ";
function StringArray (n) { this.length = n; for (var x = 1; x <= n; x++) { this[x] = ' '; } }
message = new StringArray(msgcount); // Change the following lines to your own message. message[1] = "Check out this JavaScript Slideshow!!"; message[2] = "Yet another cool effect that..."; message[3] = "you can easily add to your web pages."; message[4] = "Why don't you put it on your site?"; message[5] = "Don't forget, there are still<br>lots more scripts to check out!";
<html> <head> <title>Text Slideshow</title> <script language="JavaScript" type="text/javascript"> <!-- This script and many more are available free online at --> <!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin // change the colours below if required var background = "black"; var text = "white"; var URL = "textslideshow.htm"; // change this to the page you want to go to after the slideshow finishes var speed = 4000; // time in milliseconds (4000 = 4 secs) var msgcount = 5; // change this to the number of lines in your own message
var i = 1; var blank = " ";
function StringArray (n) { this.length = n; for (var x = 1; x <= n; x++) { this[x] = ' '; } }
message1 = new StringArray(msgcount); // Change the following lines to your own message. message1[1] = "Check out this JavaScript Slideshow!!"; message1[2] = "Yet another cool effect that..."; message1[3] = "you can easily add to your web pages."; message1[4] = "Why don't you put it on your site?"; message1[5] = "Don't forget, there are still<br>lots more scripts to check out!";
message2 = new StringArray(msgcount); // Change the following lines to your own message. message2[1] = "message 2"; message2[2] = "devrait"; message2[3] = "apparaitre"; message2[4] = "ici"; message2[5] = "voilà !";