Results 1 to 4 of 4
Thread: JS
Hybrid View
-
25th December 2008 00:29 #1
JS
.
JS.
, , . , , - raw file, . , background id- "background" , :
!Code:<HTML> <HEAD> <TITLE>DYNAMIC BACKGROUND</TITLE> </HEAD> <BODY> <TABLE border="1"> <TR> <TD width="566" height="216" id="background"> <SCRIPT> var rand_num = Math.floor(Math.random() * 4); var array_color = new Array(4); array_color[0] = #00FF00; array_color[1] = 999900; array_color[2] = #FF3333; array_color[3] = #0066FF; array_color[rand_num].getElementById("background"); </SCRIPT> </TD> </TR> </TABLE> </BODY> </HTML>Last edited by rumen_33; 25th December 2008 at 00:46.
|Asus P5K Premium WiFi|Intel C2D E6750|Kingston 2x1GB@667MHz|Seagate 250GB+500GB|Coolmax CP 500W|Asus EN 8800 GTS 320MB|
-
25th December 2008 00:49 #2
Code:array_color[rand_num].getElementById("background");
Code:document.getElementById('background').style.background = array_color[rand_num];EP35-DS4 :: Pentium Q9550 :: 4x2GB DDRII :: GeForce 9800GT :: 2x320GB SATA :: DVD-ROM :: CMPSU-450VXEU
-
25th December 2008 00:49 #3
. , . - .
.. .Code:var colors = new Array("#00FF00", "#999900", "#FF3333", "#0066FF"); document.getElementById("background").style.background = colors[Math.floor(Math.random() * colors.length)];
Last edited by z0ne; 25th December 2008 at 00:55.
-
25th December 2008 09:05 #4
. . . !
, :
Code:<HTML> <HEAD> <TITLE>DYNAMIC BACKGROUND</TITLE> </HEAD> <BODY> <TABLE border="1"> <TR> <TD width="566" height="216" id="background"> <SCRIPT> var colors_array = new Array(4); colors_array[0] = "#00FF00"; colors_array[1] = "#999900"; colors_array[2] = "#FF3333"; colors_array[3] = "#0066FF"; var rand_num = Math.floor(Math.random() * colors_array.length); document.getElementById("background").style.background = colors_array[rand_num]; </SCRIPT> </TD> </TR> </TABLE> </BODY> </HTML>Last edited by rumen_33; 25th December 2008 at 09:23.
|Asus P5K Premium WiFi|Intel C2D E6750|Kingston 2x1GB@667MHz|Seagate 250GB+500GB|Coolmax CP 500W|Asus EN 8800 GTS 320MB|




Reply With Quote
Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in