javascript - jquery css 定位中的百分比

标签 javascript jquery css

为什么下面的 JQuery 语法不正确:

 $('#Footer').css({ right: 6%, bottom: 0 });  

这个是:

 $('#Footer').css('right', '6%');
 $('#Footer').css('bottom', '0');

第一个代码中有什么不正确的地方?

提前致谢

最佳答案

6% 不是数字,因此必须指定为字符串。

$('#Footer').css({ right: '6%', bottom: 0 });  

关于javascript - jquery css 定位中的百分比,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7607871/

相关文章:

javascript - Youtube api - 如何从函数返回下一页 token ?

javascript - 用三个js将随机立方体变成随机球体

jquery - 如何使动画缓动(缓入和缓出)与持续时间无关?

jquery - 使用 jquery 设置下拉值

php - 简单的背景颜色 css jquery 切换循环

javascript - 将公共(public)变量传递给 Node.js 中的模块

javascript - 如前所述将带有文件路径的数组转换为对象

javascript - 在使用我们的默认值/占位符插件的输入字段中切换时如何修复闪烁效果?

javascript - 如何使用 Javascript 在 UIWebview 上添加填充

css - Chrome 悬停自定义光标