Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect/query currently ongoing changepage / transition in jQuery Mobile?

How can I detect/query, whether a changepage / transition is currently ongoing in jQuery Mobile (jQM)?

My goal is to prevent opening a dialog when a switch between pages is currently happening. Currently, th UI breaks when a dialog opens while a changepage event is ongoing.

Any Ideas on that?

like image 297
Michael Schmidt Avatar asked Dec 01 '25 14:12

Michael Schmidt


1 Answers

In JQM 1.4.0 the class ui-mobile-viewport-transitioning is added the body tag during transitions so the following works for me:

if (!$("body.ui-mobile-viewport-transitioning").length) {
   //do something
}else{
    console.log("Don't do it we are transitioning")
    return false
 }
like image 100
Max Avatar answered Dec 03 '25 03:12

Max



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!