문제

I'm new at jQuery and want to know if its possible to take some variables and get their division as CSS width. So far I'm here:

var x = $(".some-container").length;
var y = $("#some-div").width();
$(".container").css("width", "x / y");

thanks for any help!

도움이 되었습니까?

해결책

$(".container").css("width", (x / y));

OR

$(".container").css("width", function(){
 return (x / y);
});
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top