我有一个使用jQuery移动的输入元素。会发生什么,是加速用户使用滑块这将创建一个像这样的输入元素:基于动态内容创建css样式
for(var a = 0;a < $(this).val();a++) {
$("#boxnumber").append('<div data-role="fieldcontain"><label for="boxamount" class="ui-input-text">Enter box ' + (a + 1) + ' number:</label><input type="text" name="boxamount-' + a + '-no" id="boxamount-' + a + '-no" class="ui-input-text ui-body-null ui-corner-all ui-shadow-inset ui-body-a"/></div>')
}
问题是2倍。首先找到一种方法来设置箱量的CSS?这是一个问题的原因是对于每个值,boxamount名称都会更改。
boxamount-' + 1 + '-no" id="boxamount-' + 1 + '-no, boxamount-' + 2 + '-no" id="boxamount-' + 2 + '-no
等。其次,覆盖jQuery UI的创造我自己的类。所以我想要做的是这样的:
#boxnumber input#boxamount- <- The problem. This is dynamic. I can use any
class that you wish here and specify in the input.
{
width:25%;
margin: 0 0 0 10px;
display: inline-block;
}
我会很感激,如果有人可以让我看到热的克服这一点。在css3中有没有一些狂野的命令?谢谢
谢谢你的帮助 – bollo