Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/dart/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery mobile jquery移动事件:页面完全显示后_Jquery Mobile - Fatal编程技术网

Jquery mobile jquery移动事件:页面完全显示后

Jquery mobile jquery移动事件:页面完全显示后,jquery-mobile,Jquery Mobile,使用JQM开发web应用程序,在页面完全显示后,我可以使用什么事件来代替pageshow在页面上设置div动画,以便用户可以看到它 现在我用的是: $(document).on('pageshow','#welcome-page', function(){ if (!firstlaunch){ $('#miniWeightLevel').hide(); } else { $("#userdata").animate({width:'40px',

使用JQM开发web应用程序,在页面完全显示后,我可以使用什么事件来代替
pageshow
在页面上设置div动画,以便用户可以看到它

现在我用的是:

$(document).on('pageshow','#welcome-page', function(){


    if (!firstlaunch){
        $('#miniWeightLevel').hide();
    } else {
        $("#userdata").animate({width:'40px', height:'30px'},3000);
        $("#userdata").hide();
        $('#miniWeightLevel').show();
    }
    $('#miniWeightLevel').on('click', function(){   
            $('#miniWeightLevel').hide();
            $('#userdata').removeAttr("style").removeAttr("width").removeAttr("height");
            $("#userdata").show();
        }); 

});
但是,当页面完成diplay时,动画已经完成


谢谢

根据使用的jQM版本,
pagechange
1.3
pagecontainertransition
1.4,但两者都不能绑定到特定页面。丑陋的解决方案是
setTimeout
500ms左右。您好,我使用的是1.3.2,带有pagechange或pagecontainertransition,动画根本不会启动……正如我所说,
setTimeout()
是唯一丑陋的解决方案。我会考虑其他解决方案好的,谢谢@Omar,设置超时有效。是否要编写解决方案?还是我做?