jQuery 翻译 jQuery 增加的价值
jQuery translate value adding by jQuery
wHeight = $(window).height();
$('.test').css({"-moz-transform":"translate(0," +wHeight+ ")" });
这是我的代码,但出现错误?
如何通过 jQuery
添加值
你错过了css中的px
translate(0, npx)
是正确的,jQUery css({})
函数不会添加默认的px
当css 属性 有多个参数
这将是正确的,如果单个参数
$("<selector>").css({'height': wHeight})
但 translate()
正确地接受多个参数,因此您需要添加 unit
和值
$('.test').css({"-moz-transform":"translate(0," +wHeight+ "px)" });
wHeight = $(window).height();
$('.test').css({"-moz-transform":"translate(0," +wHeight+ ")" });
这是我的代码,但出现错误? 如何通过 jQuery
添加值你错过了css中的px
translate(0, npx)
是正确的,jQUery css({})
函数不会添加默认的px
当css 属性 有多个参数
这将是正确的,如果单个参数
$("<selector>").css({'height': wHeight})
但 translate()
正确地接受多个参数,因此您需要添加 unit
和值
$('.test').css({"-moz-transform":"translate(0," +wHeight+ "px)" });