Hi,
Please correct me if I misunderstood. To enable swipe -listeners for dynamic content, you could add listeners to the container element and then populate container dynamically.
Below is a snippet from one exercise.
HTML
Code:
<body>
<div id="tweetContainer">
<div id="tweets">
</div>
</div>
<script type="text/javascript">
mwl.addSwipeLeftListener('#tweetContainer', "mwl.setGroupNext('#tweets', 'tweet', 'tweetHidden', 'next')");
mwl.addSwipeRightListener('#tweetContainer', "mwl.setGroupNext('#tweets', 'tweet', 'tweetHidden', 'prev')");
</script>
</body>
JavaScript
Code:
function handleTwitterData(data){
clearTweets();
var tweets = document.createElement("div");
tweets.id = "tweets";
document.getElementById("tweetContainer").appendChild(tweets);
var tweetEntries = data.results;
for(var i=0; i < tweetEntries.length; i++){
var tweet = tweetEntries[i];
addTweet(tweet,i, tweetEntries.length);
}
mwl.setGroupTarget('#tweets','#tweet_0', 'tweet', 'tweetHidden'); //show first, hide others
}
-Ilkka