Search code examples
javascriptjqtouch

Simulating Animation jQTouch


I would like to simulate an animation jQTouch in this function:

$(function(){
$('#form').submit( function(e){
        $.get('/result.php', function(data) {
    document.getElementById("result").innerHTML=data;   
    });
    CODE?!?
});

The function retrieves the data and writes it to the div "result", I would that after writing data, make an animation '.slideup' from #home to #result.


Solution

  • You can use jQT.goTo(Page, Animation) to transit to another "page" with a specified animation, e.g.

    $('#form').submit(function(e) {
        $.get('/result.php', function(data) {
            $("result").html(data);
            jQT.goTo('#result', 'slideup');
        });
    });
    

    Here's the documentation: https://github.com/senchalabs/jQTouch/wiki/functions.