Strict Standards: Resource ID#25 used as offset, casting to integer (25) in /home/tvoyweb/domains/tvoyweb.ru/public_html/forums/include/fm.class.php on line 401

Strict Standards: Resource ID#27 used as offset, casting to integer (27) in /home/tvoyweb/domains/tvoyweb.ru/public_html/forums/include/fm.class.php on line 401

Strict Standards: Resource ID#28 used as offset, casting to integer (28) in /home/tvoyweb/domains/tvoyweb.ru/public_html/forums/include/fm.class.php on line 401
ТвойWeb :: Версия для печати :: Вывод текста в случайном порядке [2]
ТвойWeb » WebMaster класс » JavaScript » Вывод текста в случайном порядке

Страниц (2): « 1 [2]
 

11. RaZoR - 09 Мая, 2005 - 16:56:09 - перейти к сообщению
Вот, что-то приблизительное сделал...
CODE:
<script language="JavaScript">
<!--
var array=['1','2','3','4','5','6','7','8','9','10'];
var count=array.length;
function cmp(a, b) {
if (Math.round(Math.random())==0)
return -1;
else return 1;
}
array=array.sort(cmp);
for (i=0;i<count;i++)
{
document.write(array[i]+'<BR>');
}
//-->
</script>
12. Puncher - 09 Мая, 2005 - 17:11:59 - перейти к сообщению
Огромное спасибо Улыбка!

Форум на AlfaSpace.NET


Powered by ExBB
ExBB FM 1.0 RC1 by TvoyWeb.ru
InvisionExBB Style converted by Markus®

[Script Execution time: 0.0295]     [ Gzipped ]



Notice: ob_end_flush(): failed to send buffer of ob_gzhandler (1) in /home/tvoyweb/domains/tvoyweb.ru/public_html/forums/include/page_tail.php on line 33