Reputation: 1813
I found another SO question that had a fiddle with similar functionality to what I'm trying to do. Instead of swiping to a new div however I would like to simply slide the div off the screen
$("#listitem").swiperight(function() {
$.mobile.changePage("#page1");
});
The div in question is actually a jQuery UI dialog, $("#div").dialog({...});. I would like to simply swipe it off the screen and close it.
Upvotes: 0
Views: 367
Reputation: 11717
Use this:
$("#listitem").swiperight(function() {
$.mobile.changePage("#page2");
});
And point page to to a blank page
Upvotes: 0
Reputation: 57309
Something like this:
$('#home').live('pagebeforeshow',function(e,data){
$("#listitem").bind('swiperight',function(event, ui){
$.mobile.changePage("#page1", { transition: "slide", reverse: true});
});
});
Example: http://jsfiddle.net/Gajotres/UaupV/
Upvotes: 1
Reputation: 1326
Assuming that you're talking about a popup you can do stuff like this :
$("#listitem").swiperight(function() {
var t = $(this);
t.animate({
right: '-999px'
}, 'slow', function() {
t.remove();
})
});
Upvotes: 0