AliMD / 1Tuts

:+1: Web Design Technology Tutorials
http://ali.md/tuts
63 stars 41 forks source link

Multi dimension `for` (creates many divs like table) #382

Closed dante1357 closed 11 years ago

dante1357 commented 11 years ago

saleym be hame mohandesan! man ye for daram ke miad ye tedad div misaze, hala mikham dakhelesh ye for dge bezaram ke dakhele har div chand ta div dge besaze. chijuri benvisam? vazeh bud?! :D

omidgharib commented 11 years ago

@dante1357 rahhaye ziyadi hastesh bastegi be karet ham dare mituni html node besazi dakheleshun add koni inam yek rahe rahate http://jsbin.com/emesol/6/

dante1357 commented 11 years ago

man nemifahmam chera vaghti ru ye div mizani ke divaye dakhelish pakhsh beshan, position esh ham chenan relative mimune be div e avali!!!! :| kasi mitune komak kone!? http://jsbin.com/alisot/1/edit

omidgharib commented 11 years ago

@dante1357 ino bebin game omidvaram ke javabeto gerefte bashi :)

dante1357 commented 11 years ago

@omidgharib man eghad khabam miad farda check esh mikonam! :D thx! :X

omidgharib commented 11 years ago

@dante1357 YWC :)

dante1357 commented 11 years ago

@omidgharib in tikasho ye tozih midi?!

for(var i=0 ; i<max ; i++){ for(var j=0 ; j < 5 ; j++){ for(var k=0 ; k < 5 ; k++){ innerDivs.item(j_5+k).style.top=j_8+'px'; innerDivs.item(j_5+k).style.left=k_8+'px'; innerDivs.item(j_5+k).style.backgroundColor=bgColor; } } divs.item(i).style.webkitTransition = ' top ' + ((max-i)_70+700) + 'ms linear';

mikham bedunam j_5+k chie daghighan? va un 70_700 az koja umade!

dante1357 commented 11 years ago

j_8 va k_8 ham ye tozihi bede! :D tnx!

omidgharib commented 11 years ago

@dante1357 nigah man omadam yek seri tag div gereftam dakheleshun tedadi tag li position dadam on for avali (i) dar haghighat beyne div ha micharkhe on j va ke position midam li haye dakhele har div o :)

dante1357 commented 11 years ago

@omidgharib hamsaye baghal dastimun morde! tamarkoze man reside be -2! :| beza baresi konam bebinam mifahmam chi migi! :D

omidgharib commented 11 years ago

ok manam miram birun shab miyam javabeto midam :)

dante1357 commented 11 years ago

@omidgharib na bebin midunam un position mide un ghesmate select kardane item o nemifahmam. unja ke zadi item(j_5+k). inja man nemifahmam j_5+k chejuri hesab mishe ye ki az 25 ta li o migire!

omidgharib commented 11 years ago

@dante1357 are daghighan dune dune li ha hesab mishe

AliMD commented 11 years ago

@dante1357 bezar sare class ye simple sample mizanam :D

AliMD commented 11 years ago

@omidgharib rahet kheyli jaleb nist ! for e aval dige ezafiye, kollan code ezafe ziyad dare :D ye nokteye kheyli kheyli sade dare !

for(var i=0;i<10;i++){
  document.write('<div class="outerdiv">'); // ki gofte ke bayad hatman mogheye write div ro bebandin ?!
  for(var j=0;j<10;j++){
    document.write('<div class="innerdiv"></div>');
  }
  document.write('</div>');
}

Live: http://jsbin.com/uzetuf/3/edit?html,live

omidgharib commented 11 years ago

@AliMD ostad asheghetam :kiss: vali ag bekhaym az document.write estefade nakonim va file js joda dashte bashim az che rahi berim?

dante1357 commented 11 years ago

@AliMD hehehe! :D che jaleb! :+1: harekate nabastane div kheyli khub bud! :D :+1:

dante1357 commented 11 years ago

@omidgharib nemishe madaresho berizim tu ye motaghayer bad begim innerHTML sho taghit bede?

omidgharib commented 11 years ago

@dante1357 chera ke mishe goftam ke koli rah hast :)) be tedade ensanha rah residan be khuda hast bashad ke rastegar shavim

dante1357 commented 11 years ago

@omidgharib :)