Kee*_*ker 19 html javascript events dom
我想overflow-x用jQuery 设置css属性,但它不起作用:
$('.mySelector').css({
    color: 'Red',
    overflow: 'auto',
    overflow-x: 'scroll'
});
Run Code Online (Sandbox Code Playgroud)
我如何设置其中包含' - '(破折号)的属性?
Mic*_*son 26
你可以使用任何一个驼峰案例:
$('.mySelector').css({
    color: 'Red',
    overflow: 'auto',
    overflowX: 'scroll'
});
Run Code Online (Sandbox Code Playgroud)
或引用的键:
$('.mySelector').css({
    color: 'Red',
    overflow: 'auto',
    'overflow-x': 'scroll'
});
Run Code Online (Sandbox Code Playgroud)
我会推荐引用的密钥,我发现更容易告诉"一目了然"与骆驼套管相比的规则.
|   归档时间:  |  
           
  |  
        
|   查看次数:  |  
           33366 次  |  
        
|   最近记录:  |