(function ($) {$ .extend ({notify: function (options, duration) {var defaults = {inline: true, href: ') ', html:' '}; var options = $ .extend (по умолчанию, параметры); var body = $ (' body '), container = $ ('
') .attr (' id ' , 'notification_area'), wrapper = ' ', clone; if (! body.hasClass ('notifications_active')) {body.append (container) .addClass ('notifications_active' );} if (options.inline == true && options.href) {clone = $ (options.href) .clone (). wrap (wrapper);} clone.css ('видимость', 'скрытый'). appendTo (контейнер); var clone_height = 0 - parseInt (clone.outerHeight ()); clone.css ('marginBottom', clone_height); clone.animate ({marginBottom: 0}, 'fast', function () {clone.hide () .css ('видимость', 'видимый'). fadeIn ('быстро');});}});}) (jQuery); $ (funct ion () {$ ('a'). click (function () {$ .notify ({inline: true, href: '#alert'}, 3000)})})
http://jsfiddle.net/sambenson/RmkEN/
В приведенном выше пример Я клонирую элемент и пытаюсь обернуть его и
, но клон вообще не оборачивается. Почему?