Быстрые уведомления
Доброго времени суток ув. знатоки в который раз прошу вас помощи помогите переделать скрипт уведомлений чтоб уведомление постоянно выводило при нажатии а не один раз.
Вот такой скрипт уведомления. .adding { position: relative; left: -35px; top: -4px; display: none; } $(document).ready(function(){ $('<span>Добавлено</span>') .addClass('adding') .insertAfter('.notif'); $('.notif') .click(function(e) { doOneUp(this, function() { $(this).prev().text('Added'); }); e.preventDefault(); }); }); function doOneUp(which, callback) { $(which) .next() .show() .animate({ top: "-=50px", opacity: "toggle" }, 1000, function() { $(this) .css({top: ""}) .hide('slow', callback) .remove(); }); } <a class='notif' href=#>тест</a> Заранее огромное спасибо)) |
Цитата:
<!DOCTYPE html> <html> <head> <script src='http://code.jquery.com/jquery-latest.js'></script> <!-- <link rel='stylesheet type=text/css href=tmp.css' /> --> <style type='text/css'> .adding { position: relative; left: -35px; top: -4px; display: none; } </style> <script type='text/javascript'> $(function(){ $('<span>Добавлено</span>') .addClass('adding') .insertAfter('.notif'); $('.notif') .click(function(e) { doOneUp(this, function() { $(this).prev().text('Added'); }); e.preventDefault(); }); }); function doOneUp(which, callback) { $(which) .next() .show() .animate({ top: "-=50px", opacity: "toggle" }, 1000, function() { $(this) .css({top: ""}) .hide('slow', callback); //.remove(); }); } </script> </head> <body> <a class='notif' href=#>тест</a> </body> </html> |
ksa, Спасибо большое) Не первый раз выручаешь)))
|
Часовой пояс GMT +3, время: 07:25. |