I made a code that should generate multiple inputs
:
var n = document.getElementById("numeroCamadas").value
var ttt;
var layers = {}
for (var i =0; i<n; i++){
layers["layer" + i] = {
'espessura':0 ,
'altura':0 ,
'pesoEspecifico':0,
'tensaoHorizontal':0,
'poroPressao':0,
'tensaoTotal':0,
'tensaoTotalMeio':0,
'tensaoTotalEfetiva':0,
'tensaoTotalEfetivaMeio':0};
ttt +="<li class=\"ui-field-contain\">"
+"<h5>Camada "+(i+1)+"</h5>"
+"<div style=\"float:left; width:30%;\">"
+"<input type=\"number\" placeholder=\"Altura"+(i+1) +"\" value=\"\" id=\"altura"+(i+1) +"\" onfocusout=\"tensao()\">"
+"</div>"
+"<div style=\"float:left; width:30%;\">"
+"<input type=\"number\" placeholder=\"Peso Especifico"+(i+1) +"\" value=\"\" id=\"pesoEspecifico"+(i+1) +"\" onfocusout=\"tensao()\">"
+"</div>"
+"<div style=\"float:left; width:30%;\">"
+"<input type=\"number\" placeholder=\"Tensão Horizontal"+(i+1) +"\" value=\"\" id=\"geraCamadasHorizontal"+(i+1) +"\" onfocusout=\"tensao()\">"
+"</div>"
+"<br>"
+"<li>Espessura da Camada:<b id=\"espessuraCamada"+(i+1) +"\"></b></li>"
+"<li>Tensão Total:<b id=\"uMedia\"></b></li>"
+"<li>Tensão Efetiva:<b id=\"fc\"></b></li><br>"
+"</li>"
}
document.getElementById("camadas").innerHTML=ttt
}
The code works, but everything it generates does not come with CSS, which is the CSS of jquery.mobile-1.4.5.min.css
.
Is there any function to call CSS or something like that ???
I was advised to do this:
$(".ui-field-contain").css("border-bottom-width","1px");
$(".ui-field-contain").css("border-bottom-right-radius","inherit");
$(".ui-field-contain").css("border-bottom-left-radius","inherit");
$(".ui-field-contain").css("border-top-left-radius","inherit");
$(".ui-field-contain").css("padding","0.7em 1em");
$(".ui-field-contain").css("border-right-width","1px");
$(".ui-field-contain").css("border-left-width","1px");
$(".ui-field-contain").css("border-width","1px 0 0");
$(".ui-field-contain").css("border-style","solid");
$(".ui-field-contain").css("margin","0");
$(".ui-field-contain").css("display","block");
$(".ui-field-contain").css("position","relative");
$(".ui-field-contain").css("text-align","left");
$(".ui-field-contain").css("text-overflow","ellipsis");
$(".ui-field-contain").css("overflow","hidden");
$(".ui-field-contain").css("white-space","nowrap");
$(".ui-field-contain").css("background-color","white");
$(".ui-field-contain").css("border-color","#ddd");
$(".ui-field-contain").css("color","#333");
$(".ui-field-contain").css("text-shadow","0 1px 0 #f3f3f3");
$("input").css( "margin" , "0" );
$("input").css( "min-height" , "2.2em" );
$("input").css( "text-align" , "left" );
$("input").css( "border-radius" , "5px" );
$("input").css( "background" , "transparent none" );
$("input").css( "line-height" , "1.4em" );
$("input").css( "display" , "block" );
$("input").css( "width" , "auto" );
$("input").css( "box-sizing" , "border-box" );
$("input").css( "outline" , "0" );
$("input").css( "color" , "inherit" );
$("input").css( "text-shadow" , "inherit" );
$("input").css( "font-size" , "1em" );
$("input").css( "font-family" , "sans-serif" );
$("#cfc").css( "margin-left" , "5em" );
But it's a lot of work, and it's not giving a legal result.
Follow the index as requested
Soil stresses
Menu<div role="main" class="ui-content">
<ul data-role="listview" data-inset="true">
<li class="ui-field-contain">
<label style="width:3em; float:left;">Número de Camadas</label>
<div style="float:right; width:30%;">
<input type="number" value="2" id="numeroCamadas" onfocusout="()">
<button onclick="geraCamadas()">Gerar Camadas</button>
</div>
</li>
</ul>
<ul data-role="listview" data-inset="true" id="camadas">
<li class="ui-field-contain">
<h5>Camada 1</h5>
<div id="cfc" style="float:left; width:30%;">
<input type="number" placeholder="Altura" value="" id="altura1" id="put" onfocusout="">
</div>
<div id="cfc" style="float:left; margin-left: 0.5em; width:30%;">
<input type="number" placeholder="Peso Espeçifico" value="" id="PesoEspecifico1" onfocusout="tensao()">
</div>
<div id="cfc" style="float:left; margin-left: 0.5em; width:30%;">
<input type="number" placeholder="Tensão Horizontal" value="" id="TensaoHorizontal" onfocusout="tensao()">
</div><br>
</li>
<li>Umidade média:<b id="uMedia"></b></li>
<li>Fator Correção:<b id="fc"></b></li>
</ul>
</div>
<div data-role="footer">
<h4>Page Footer</h4>
</div><!-- /footer -->
</body>