Hi
I build slideshow with 10 visible thumbnails. After each 10 pictures I
move thumbnails to show next 10.
Another words
if (id==11 || id==21 || id==31) {do something}
How to write more wise if statement?
Thanks
___
Flashcoders mailing list
Use
if ( anynumber % 10 == 1 ) {do something}
Hi
I build slideshow with 10 visible thumbnails. After each 10 pictures I
move thumbnails to show next 10.
Another words
if (id==11 || id==21 || id==31) {do something}
How to write more wise if statement?
Thanks
Untested email code. But you get the gits of it, I hope
// properties
var ThumbnailSetSize = 10;
var i = 0;
var page = 0;
/// on next image
i++;
if (i == ThumbnailSetSize ){
page++;
i=0;
//Do something
}
id = (page*ThumbnailSetSize ) + i;
HTH/Christoffer
natalia Vikhtinskaya skrev:
Thank you! What if I want to show 8 or 12 images?
2008/4/14, Kai Feldmaier [EMAIL PROTECTED]:
Use
if ( anynumber % 10 == 1 ) {do something}
Hi
I build slideshow with 10 visible thumbnails. After each 10 pictures I
move thumbnails to show next 10.
Another words
if (id==11 || id==21
Only change 10 to any other number. % means mod - it calculates the rest
of the division. So if you want to show 8 images, write
if ( anynumber % 8 == 1 ) {do something}
anynumber % 8 == 1 happens when anynumber is 9, 17, ...
same to 12 or any other modular event
Thank you! What if I want
Thank you again, it what I need.
2008/4/14, Kai Feldmaier [EMAIL PROTECTED]:
Only change 10 to any other number. % means mod - it calculates the rest
of the division. So if you want to show 8 images, write
if ( anynumber % 8 == 1 ) {do something}
anynumber % 8 == 1 happens when anynumber is
6 matches
Mail list logo