Created
July 11, 2011 03:16
-
-
Save micahalles/1075275 to your computer and use it in GitHub Desktop.
Functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var comments = ["Sounds delicious!", "What next?!?"]; | |
// or, if there are no comments | |
// var comments = []; | |
$("#my-template").expand({ | |
content: "Step 1, light the grill. Step 2...", | |
comments: function(el) { | |
if (comments.length == 0) { | |
return false; // this will remove the comments div | |
} else { | |
return comments; | |
} | |
} | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> | |
<span class="content">Step 1, light the grill. Step 2...</span> | |
<div class="comments"> | |
<div class="comment">Sounds delicious!</div> | |
<div class="comment">What next?!?</div> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> | |
<span class="content">Step 1, light the grill. Step 2...</span> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="my-template"> | |
<span class="content"></span> | |
<div class="comments"> | |
<div class="comment"></div> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment