twbs / ratchet

Build mobile apps with simple HTML, CSS, and JavaScript components.
http://goratchet.com
MIT License
14.63k stars 1.45k forks source link

How to Programmatically call PUSH function #627

Open bueckl opened 10 years ago

bueckl commented 10 years ago

Hi,

can somebody tell me how to programmatically call the PUSH function and pass the animation direction? There's no way to pass the direction!?

That's what I have so far (dirty hacked into ratchet.js within the ajax success method). This is working, but i can't control the animation direction:

$(data.contents).find('.content-bottom').on('swipeRight', function(e){ PUSH({ url: "theme1.php", transition: "slideOut" }); });

Any Ideas? Thankyou!

sailor commented 10 years ago

Try this:

PUSH({url: 'theme1.php', transition: 'slide-out'});

jgauna commented 9 years ago

Why this method isn't public ? I think it should be good if it's on documentation

Johann-S commented 9 years ago

It is a public method (https://github.com/twbs/ratchet/blob/master/js/push.js#L521#L522) and it's now on the documentation (https://github.com/twbs/ratchet/pull/753)