javascript - How to prevent div's height enlarging with fiddle now) -
asked question yesterday. fiddle works fine problem empty space after image. how can prevent it? js:
var indentionfix=0; var topindentioninfo=-730; var leftindentioninfo=100; var data="3|name1 a,4|name2 a,1|name3 a,2|name4 a,5|name5 a,6|name6 a,8|name7 a,555|name8 a"; var tickets=data.split(","); var ticketsamount=math.ceil(tickets.length/4); var ticketscount=0; for(var i=0;i<ticketsamount;i++){ $("body").append("<div id='wrapperdiv_"+i+"' class='wrapperdiv'><img src='http://s30.postimg.org/d4fb4w9ox/for_print.jpg' /></div>"); topindentioninfo=-730; indentionfix=0; for(var j=0;j<4;j++){ if(ticketscount<tickets.length){ var infodiv=$("#wrapperdiv_"+i).append("<div id='infodiv_"+ticketscount+"''></div>"); $("#wrapperdiv_"+i).css({"min-height":"500pt"}) $("#infodiv_"+ticketscount).css({position:"relative",width:"200px","min-height":"140px",top:topindentioninfo+"pt",left:leftindentioninfo+"pt"}); topindentioninfo+=90; topindentioninfo-=indentionfix; indentionfix+=3; var topindentionnumber=3; var leftindentionnumber=100; var topindentionsurname=5; var topindentionfirstsecondname=5; var ticketvalues=tickets[ticketscount].split("|"); // Добавление номеров к листу билетов var number=$("#infodiv_"+ticketscount).append("<div id=number_"+ticketvalues[0]+">"+ticketvalues[0]+"</div>"); $("#number_"+ticketvalues[0]).css({position: "relative", top: topindentionnumber+"pt", left: leftindentionnumber+"pt", "font-size":"16pt"}); // Добавление ФИО к листу билетов var fiosplit=ticketvalues[1].split(" "); var surname=fiosplit[0].touppercase(); var firstsecondname=fiosplit[1]+" "+fiosplit[2]; var surnamediv=$("#infodiv_"+ticketscount).append("<div class='fio' id=surname_"+ticketvalues[0]+">"+surname+"</div>"); var firstsecondnamediv=$("#infodiv_"+ticketscount).append("<div class='fio' id=firstsecondname_"+ticketvalues[0]+">"+firstsecondname+"</div>"); $("#surname_"+ticketvalues[0]).css({position: "relative", top: topindentionsurname+"pt", width:"200px", "font-size":"16pt", "min-height":"20pt"}); $("#firstsecondname_"+ticketvalues[0]).css({position: "relative", top: topindentionfirstsecondname+"pt", width:"200px", "font-size":"16pt"}); ticketscount++; } } }
Comments
Post a Comment