<tr />
의 배경을 변경하면서 AJAX 청원서에서 수정 된 필드를 알리려고하고 있지만 제대로 작동하지 않습니다.jQuery는 실제 CSS 배경색을 저장하고 새로운 것을 적용한 다음 원본을 복원합니다.
내 코드는 AJAX 청원을 포함하지만 문제가 함께이 권리 처리 :
var $this = $(this);
if(confirm("Delete?"))
{
// My AJAX petition returns TRUE or FALSE, if TRUE:
// Store the ORIGINAL color
var ORIGINAL = $this.closest("tr.entry").css('backgroundColor');
// The alert works fine
alert(ORIGINAL);
// Change the color with the desired and then change with the original after a delay.
// If i dont use the delay() and the second css() works fine.
$this.closest("tr.entry").css('backgroundColor','#ace997').delay(500).css('backgroundColor', ORIGINAL);
}
사전에 감사를!
jQuery 1.4를 사용하고 계십니까? – BoltClock
@BoltClock : 예, 있습니다. – ipalaus
첫 줄에 var $ this = $ (this);를 읽어야합니다. – bozdoz