dio-v
12/4/2014 - 6:37 AM

create a div tag

create a div tag

var warning = $('<div />', {
    class: 'warning',
    style:'display:none;',
    text: 'niet alle vragen zijn nog beantwoord'
});


//example
$('.element').after(warning.css({ 'opacity': 0, 'display': 'inline-block', 'left': '-80px', 'position':'relative' }).animate({ 'opacity': 1, 'left': '20px' }, animationSpeed, 'easeOutCirc', function () {
    setTimeout(function () {
        warning.animate({ 'opacity': 0, 'left': '150px' }, animationSpeed, 'easeInCirc', function () { warning.remove() });
    }, 2000);
}));