anonīms Posted July 25, 2011 Report Share Posted July 25, 2011 $('.page-user-3-orders.section-user th:nth-child(4)').addClass('last'); kā ir jāaizvieto to 3nieku, lai kods darboties ar jebkādu tur ielikto skaiti? Quote Link to comment Share on other sites More sharing options...
0 briedis Posted July 25, 2011 Report Share Posted July 25, 2011 Vienkārši ou-mai-gād, ko tu te dari vairāk kā 3 gadus? :D http://www.tizag.com/javascriptT/ Quote Link to comment Share on other sites More sharing options...
0 codez Posted July 25, 2011 Report Share Posted July 25, 2011 Diezvai tā var. Ieliec visiem vienādu papildus klasi un selekto pēc tās. Quote Link to comment Share on other sites More sharing options...
0 anonīms Posted July 25, 2011 Author Report Share Posted July 25, 2011 (edited) sitiens starpkājām, auch ;D Nu man tas vairāk ir "uz sitienu" tāpēc ar prasu un ar js tā nestrādāju pat pusgadu, bet zinu, ka tas nav attaisnojums. Esmu slinks :P EDIT: cmon, tur tak nekā nav Edited July 25, 2011 by anonīms Quote Link to comment Share on other sites More sharing options...
0 anonīms Posted July 25, 2011 Author Report Share Posted July 25, 2011 (edited) codez, tas ir tāds gadījums, kur to vnk nevar izdarīt :]]]]] Edited July 25, 2011 by anonīms Quote Link to comment Share on other sites More sharing options...
0 briedis Posted July 25, 2011 Report Share Posted July 25, 2011 ehhh "virkne-" + mainigias + "-virkne" Quote Link to comment Share on other sites More sharing options...
0 anonīms Posted July 25, 2011 Author Report Share Posted July 25, 2011 (edited) cmon briedi. Nejau es to mainīgo tagad padošu kaut kur. Var būt kaut 1331414, bet es viņu nekādā gadījumā nepadošu! Tam ir jānotiek automātiski, tur jau tā sāls. Supertizls variants būtu savākt tā diva klases, atdalīt katru klasi. īsto explodot un pēc tam savākt id un padot, bet tik perverss es ar neesmu Edited July 25, 2011 by anonīms Quote Link to comment Share on other sites More sharing options...
0 codez Posted July 25, 2011 Report Share Posted July 25, 2011 (edited) Vari pamēģināt pievienot jquery regex filtru jquery selektoram un tad selectorā lietot regugulārās izteiksmes. http://james.padolsey.com/javascript/regex-selector-for-jquery/ varētu būt šādi: $('div:regex(class,page-user-[0-9]-orders).section-user th:nth-child(4)') Edited July 25, 2011 by codez Quote Link to comment Share on other sites More sharing options...
0 briedis Posted July 25, 2011 Report Share Posted July 25, 2011 Nu tad dari tā kā codez saka - pievieno papildus identificējošu klasi, kas arī būtu saprātīgākais risinājums.. Quote Link to comment Share on other sites More sharing options...
Question
anonīms
kā ir jāaizvieto to 3nieku, lai kods darboties ar jebkādu tur ielikto skaiti?
Link to comment
Share on other sites
8 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.