$(document).ready(function () { $("body").append('<div id="notesBlock"></div>'); $('body').click(function () { $('#notesBlock').append('<div class="note error">error</div>'); $('#notesBlock .note:last').slideDown(150); if (notesOff) clearTimeout(notesOff); var notesOff = setTimeout(function () { $('#notesBlock .note').remove(); }, 4000); }); });
$(document).ready(function () { $("body").append('<div id="notesBlock"></div>'); $(document).click(function () { $('#notesBlock').append('<div class="note error">error</div>'); $('#notesBlock .note:last').slideDown(150); if (arguments.callee.notesOff) clearTimeout(arguments.callee.notesOff); arguments.callee.notesOff = setTimeout(function () { $('#notesBlock .note').remove(); }, 4000); }); });
$('#notesBlock .note:last').slideDown(150).delay(3000).slideUp(300, function(){$(this).remove();});
if (элемент) alert(1);
if ($("#id").length == 0) alert("Element do not exist")