我在单个div中有两个使用jQuery UI的进度条(通过细分div)。我还设法让他们使用修改后的jQuery UI进度条形码(从this forum thread绘制)进行垂直绘制。但它们并没有像预期的那样被画在一起。
下面是我设置它们的代码:
function drawVBar(self,average,eid)
{
var mainid="#"+eid;
var target = $ ("#" + eid),
first= target.find(".first"),
second= target.find(".second");
if(!first[0])
{
first= $("<div>").addClass("first").appendTo(target);
second= $("<div>").addClass("second").appendTo(target);
}
first.progressbar({value: self,orientation: 'vertical'});
second.progressbar({value: average,orientation: 'vertical'});
} 有没有人能告诉我,我该如何设计它们的样式,使它们并排显示?
发布于 2011-12-07 23:26:30
如果它们被包装在一个div中,那么您可以尝试使用float:left,甚至可以使用display:inline。如果您将它们浮动起来,这会打乱您的页面布局,请尝试使用overflow:auto将它们包装在div中
function drawVBar(self,average,eid)
{
var mainid="#"+eid;
var target = $ ("#" + eid),
first= target.find(".first"),
second= target.find(".second");
if(!first[0])
{
first= $("<div style='float:left'>").addClass("first").appendTo(target);
second= $("<div style='float:left'>").addClass("second").appendTo(target);
}
first.progressbar({value: self,orientation: 'vertical'});
second.progressbar({value: average,orientation: 'vertical'});
} https://stackoverflow.com/questions/8416018
复制相似问题