Documentation

Talk:Tutorials:jQuery For Designers

From jQuery JavaScript Library

Jump to: navigation, search

There's something a little weird about this page. The page says that the code for the example is:

<script> //<![CDATA[    
   // When the page is ready
   $(document).ready(function(){
     $(".article .thebody").hide();
     $("#container .article ul")
       .prepend("<li class='readbody'><a href='' title='Read the article'>Read Body</a></li>");
     
     $(".actions li.readbody a").click(function(event){
       $(this).parents("ul").prev(".thebody").toggle();
       
       // Stop the link click from doing its normal thing
       return false;
     });
   });
 //]]></script>

but when I look at the source of the page, the code is different:

<script> //<![CDATA[    
   // When the page is ready
   $(document).ready(function(){
     $(".article .thebody").hide();
     $("#container .article ul")
       .prepend("<li class='readbody'><a href='' title='Read the article'>Read Body</a></li>");
     
     $(".actions li.readbody a").click(function(event) {
              var mybody = this.parentNode.parentNode;
              while (mybody = mybody.previousSibling) {
                      if (mybody.className == "thebody") break;
              };
              if (!mybody) return;
              $(mybody).toggle();
 
              event.preventDefault();
      });
   });
 //]]></script>

Definetly not as nice... is it to work around some bug ?

Links to examples are dead links

It seems the original examples are no longer up, and thus all links to them are dead links.