I am looking for a way to disable .toggle()
attached to a div
if (condition) { $("#div").toggle( function() { do this }, function() { do that } ); } else {
More explanation:
This is a map application. toggle
associated with the image button. The map is loaded at zoom level 4. The user zooms in and the corresponding button only becomes active when the user has increased by more than zoom level 6. As soon as the user zooms in to level 6, I want the toggle button to become inactive again.
source share