매우 기본적인 질문이지만 작동시키지 못합니다. 이 스 니펫 코드는 다음과 같습니다.로그에 문자열 기호를 추가하여
$('.cube').each(function(i) {
var nleft = $(this).offset().left;
var ntop = $(this).offset().top;
var tbg = $(this).css('backgroundColor');
//output
var cval = $('#output');
cval.val(cval.val()+'cubes['+i+'].animate({left:'+nleft+',top:'+ntop+',backgroundColor:'+tbg+'});');
});
div 배열의 다른 속성을 기록합니다. 문제는 배경 - 색상 :
cubes[1].animate({left:200,top:200,backgroundColor: transparent });
이 될 로그, 당신이 볼 수 있듯이 transparent
내가 다른 곳에서 이것을 사용할 수 있습니다 ' '
에 있어야한다. 배경색이 #000
인 경우와 동일하게 문자열 표시가 있어야합니다.
바꾸기 당신이 무엇을의 마지막 부분'를 탈출의 backgroundColor를 : " '+ TBG +'"}); ' 정확히 – jonhopkins