Skip to content

Instantly share code, notes, and snippets.

@venkatd
Created November 3, 2011 20:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save venkatd/1337660 to your computer and use it in GitHub Desktop.
Save venkatd/1337660 to your computer and use it in GitHub Desktop.
nested onmatch not fired when .append is used
<!DOCTYPE HTML>
<html>
<head>
<title>
</title>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.entwine-dist.js"></script>
<script type="text/javascript">
$('.test').entwine({
onmatch: function() {
console.log('.test :: onmatch');
this.append('<div class="test_child"/>');
},
onunmatch: function() {
}
});
$('.test_child').entwine({
onmatch: function() {
console.log('.test_child :: onmatch');
},
onunmatch: function() {
}
});
window.runTest = function() {
$('body').append('<div class="test"/>');
}
</script>
</head>
<body>
<h1>
<a href="#runTest" onclick="runTest()">Run Test</a>
</h1>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment