burda da aynı kodu
quote için uyarladım. aynı özelleştirmeler bu kod için de geçerli.
bu kod sayesinde fonksiyonu (showQuotes) bir kez çağırdığınızda listede tekrarlama olmayacaktır.
<script language="JavaScript">
<!--
function showQuotes( SHOW )
{
quotes = new Array()
quotes[0] = '100.jpg'
quotes[1] = '200.jpg'
quotes[2] = '300.jpg'
quotes[3] = '400.jpg'
quotes[4] = '500.jpg'
// ======================================
// do not change anything below this line
// ======================================
quotes.sort( sort_rand )
var j = 0;
var p = quotes.length
if ( SHOW > p || SHOW < 1 )
SHOW = 0
for ( i = 0; i < SHOW; i++ )
{
print( quotes[i] )
}
}
function sort_rand( a, b )
{
return Math.floor( Math.random() * 7 )
}
function print( msg )
{
document.write( '<li>' + msg + '</li>' )
}
//-->
</script>
kaç mesaj göstereceğinizi buraya yazıyorsunuz.
kolay gelsin.