Answer the question
In order to leave comments, you need to log in
What jquery event closes select?
my plugin most likely turns the select into a list that only opens and closes when the button is clicked. What event can be applied so that this select can be closed when clicking anywhere except select-a?
Answer the question
In order to leave comments, you need to log in
In such cases, the first thing to do is to check if the event is subscribed.
In the Visual Studio IDE, you can make sure in the designer (RMB on the element -> "Properties", then the "Events" tab) and look for the required one in the list. You can also subscribe there.
Or add the subscription yourself in the constructor:
button1.Click += button1_Click;
button2.Click += button2_Click;
yes, as toggle
I don’t know jquery so much to do something that you said,
if it’s not difficult for you, you can sketch it ...
$(document).mouseup(function (e) {
var select= $("#mySelect");
if (!select.is(e.target) && select.has(e.target).length === 0) {
// тут действие для закрытия селекта
}
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question