I have some links displayed on a page. I would like to enable/disable them based on other events on the page. Is there a way to do this with jQuery?
相关问题
- How to fix IE ClearType + jQuery opacity problem i
- jQuery add and remove delay
- Include empty value fields in jQuery .serialize()
- React Native Inline style for multiple Text in sin
- Disable Browser onUnload on certain links?
and for enabling:
delegation is better than handlers, because you can call them before the dom is loaded
it depends on what you mean by "disable".
this will make them do nothing:
You could do something like:
Be sure to show that they no longer work somehow, otherwise your users will get confused, lol.
You can do something like this:
When I am giving functions to the buttons by jquery, I like to do this:
with this, you get the function just the first time you press de button. Now you just have to set indice different of value1 to your link works again