Admin Keramtech napsal(a): > asi by to slo nejakym pripoctem/odectem od konkretni hodnoty, ktera by se > rovnala treba nazvu aktualniho obrazku, napr. 09.jpg, kdy pri stlaceni > tlacitka "predchozi" by se od hodnoty 9 odecetla1 a vysledek se dal do jmena > & "0" & ".jpg". Slo by to? ---------------------------- sice by to slo, ale takto by v js vypadal zapis, aby to prepsalo treba '05.jpeg' na '04.jpeg + 05.jpeg + 06.jpeg' <script type="text/javascript"> var fotka = "05.jpeg" var reg = /^.([0-9]{1})$/; x = fotka.replace(/^([0-9]+)\.+([^ ]+)/, "$1"); x = x-1; if (reg.test(x)) {document.write(x +'<br>');} else {document.write('0'+x +'<br>');} x = x+1; if (reg.test(x)) {document.write(x +'<br>');} else {document.write('0'+x +'<br>');} x = x+1; if (reg.test(x)) {document.write(x +'<br>');} else {document.write('0'+x +'<br>');} </script> bez tech nul na zacatku by to bylo jednodussi, nemusely by tam byt ty fce. i kdyz mozna to delam blbe a nekdo to umi jednodusseji jinak, pokud chces, tak si to do te fce zamontuj... enjoy :))) -- -h!- http://www.hyneklipa.cz/ ICQ: 289612872
This archive was generated by hypermail 2.1.3 : 13. 10. 2003, 15:02 CEST