Browse Source

Listing 5.18: prepend pull quotes to their parent.

Frederic G. MARAND 8 years ago
parent
commit
b4f9f0c753
1 changed files with 5 additions and 0 deletions
  1. 5 0
      Chapter 5/05.js

+ 5 - 0
Chapter 5/05.js

@@ -44,5 +44,10 @@ $(document).ready(function () {
   $('span.pull-quote').each(function (index) {
   $('span.pull-quote').each(function (index) {
     var $parentParagraph = $(this).parent('p');
     var $parentParagraph = $(this).parent('p');
     $parentParagraph.css('position', 'relative');
     $parentParagraph.css('position', 'relative');
+
+    var $clonedCopy = $(this).clone();
+    $clonedCopy
+      .addClass('pulled')
+      .prependTo($parentParagraph);
   });
   });
 });
 });