Kar*_*way -1 html javascript jquery
我有一个如下代码
var newWidth = Math.floor(width * .75) + 'px';
$(this).find("input:first").attr('style', 'width:newWidth ');
Run Code Online (Sandbox Code Playgroud)
你可以请你纠正我,因为正确的语法是直接传递newWidth不起作用我也必须通过样式才能这样做
使用 .css()
$(this).find("input:first").css('width', newWidth);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
96 次 |
| 最近记录: |