Skip to content

Instantly share code, notes, and snippets.

@matthewryanscott
Created January 8, 2009 06:10
Show Gist options
  • Save matthewryanscott/44606 to your computer and use it in GitHub Desktop.
Save matthewryanscott/44606 to your computer and use it in GitHub Desktop.
Elements go missing
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Elements getting chopped off</title>
<script src="/js/jquery-1.2.6.js" type="text/javascript" charset="utf-8"></script>
<script src="/js/chain-0.2.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
var data = [
{
name: 'create',
label: 'New'
}
];
var parent = $('#actions');
$('#actions_template') // find the template
.clone() // keep the template intact
.items(data) // assign data to the copy
.chain({anchor: '.items'}) // chain it
.children() // grab its children
.appendTo(parent) // stick it to an element
;
});
</script>
</head>
<body>
<div id="actions"></div>
<div id="templates" style="display:none;">
<div id="actions_template">
<ul class="items">
<li class="item">
<div class="action">
<a href="#" class="label">Action Label</a>
</div>
</li>
</ul>
<div class="transaction">
Where am I?
</div>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment