Ich versuche, das geänderte Feld auf eine AJAX-Petition mit der Änderung des Hintergrunds von <tr />
geändert, aber ich kann es nicht funktionieren.jQuery speichern tatsächlichen CSS-Hintergrundfarbe, wenden Sie eine neue und dann das Original wiederherstellen
Mein Code enthält eine AJAX-Petition aber ich umgehen dieses Recht das Problem mit diesem ist:
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);
}
Danke im Voraus!
Sind Sie auf jQuery 1.4? – BoltClock
@BoltClock: Ja, ich bin. – ipalaus
Die erste Zeile sollte lesen var $ this = $ (this); – bozdoz