Question

If there a way to tell if the jQuery Mobile select menu is open? I've been trying to check in various places to see if it is open to turn off certain events or in other cases close it.

Closing it without checking works though it gives the error "Uncaught TypeError: Cannot call method 'destroy' of undefined".

Was it helpful?

Solution

I assume that you are using this option with select menu to create a custom menu popup - data-native-menu="false"

In that case you can check if the popup is visible by using this code.

if($(".ui-selectmenu").hasClass("ui-selectmenu-hidden")){
    alert("Select menu popup is hidden");
}
else{
    alert("Select menu popup is visible");
}

Let me know if that helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top