我在背景中有一个带有曲线边框的红色div,上面渲染了一个带有曲线边框的黄色div。黄色条正在慢慢填充红色条(例如用于显示进度)。请查看此fiddle:
代码
<div id="topDiv" style="height:20px; width:200px; background-color:red; border-radius:10px;">
<div id="childDiv" style="height:20px; width:100px; background-color:yellow; border-top-left-radius:10px; border-bottom-left-radius:10px;">
</div>
</div>
<br/>
<br/>
<input id="change" type="button" value="Change Width" style="height:25px; width:100px;"></input>
$("#change").click(function(){
$("#childDiv").width((parseInt($("#childDiv").width()) + 5) + "px");
});
现在,我希望黄色条的右边框在未完全填充红色条时是平的(非曲线)。但当它完全填满红色条时,应变成曲线。有人能建议最好的实现方法吗?