On the page there is a block with fixed positioning. Offset on the left edge of the screen by -100% : you need to after loading the page, after 500ms its positioning becomes left: 0% , with a speed of 500ms . and then after 5s assumed its original position. Using class assignment, I know how to do it. But I need to rewrite the left property. I tried this, but the experience is not enough:
$('.messages')(function ($) { var left = -2000; $('.messages').css('left', left); )}; .messages { display: block; position: fixed; z-index: 150; top: 40px; max-width: 600px; left: 00%; background: #97E253; padding: 5px 8px; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <div class="messages">Сообщение </div>
$('.messages').stop().animate({left: 0}, 500);+setTimeout(имя_функции, 500)- lexxl