Questions tagged [event-handling]
Event handling is a coding pattern related to acting on messages between a source and one or more subscribers. A point listener in the source provides a way in which subscribed code can consume messages raised from the source.
467 questions
4
votes
2
answers
281
views
Handling a dragging gesture using jQuery
I'm not sure if this is the right way to do this, but I want to simply this script and hopefully use CSS3 animations. The code is really large, and parts are very irrelevant, so I'm wondering if I ...
3
votes
3
answers
13k
views
Simplifying multiple mouseover and mouseout functions
I am trying to hide and show tooltips depending on what element is hovered over. This works as expected and I could continue to rinse and repeat. However, I am wondering if there is a good way to ...
4
votes
1
answer
900
views
Cross-browser double form submit prevention
We developed a potential solution for the double form submit prevention and we need some review on it. To be able to execute this code on asp.net we needed to add our function call directly into the <...
0
votes
1
answer
5k
views
Change URL on select change
I've made a method, which inserts a new query parameter, when the value of a select changes, then reloads the page. I've had enough of URL jQuery hax, so I figured it would be a great idea to put the ...
2
votes
3
answers
808
views
Options with a "yes" or "no" radio button
I have about 6 of these, but I'm only posting two. Essentially I have a bunch of options with a "yes" or "no" radio button. If "no" is selected, I want a form to popup.
...
5
votes
1
answer
6k
views
Remove an event listener after firing once or any number of times
Remove an event listener after firing once or any number of times
This is what I have:
...
3
votes
1
answer
2k
views
Keeping UI responsive while performing long running task
I recently asked for some advice on the best way to structure my code for a program I was writing. (see this question on Programmers.SE). The solution I was given was quite elegant, however I am less ...
5
votes
1
answer
159
views
Altering contents when loading iframes
I am quite new to JavaScript and I wonder if you experts can see any obvious mistakes in this working code, and if any, suggest good improvements.
...
5
votes
3
answers
223
views
4
votes
2
answers
1k
views
Click handlers for SVG polygons
How can I write this shorter?
...
7
votes
1
answer
2k
views
Even handler for text input preview
In a WPF application I have the following event handler for PreviewTextInput event in ComboBox control. The main purpose of this ...
18
votes
2
answers
30k
views
Generic EventArgs to go with generic EventHandler?
There is as of .NET 2.0 a generic EventHandler delegate type, which can be used to define an event in terms of the EventArgs ...
3
votes
2
answers
4k
views
Mouseover effect for radio buttons
I'm very much a beginner and have put together some JavaScript to control a pair of radio buttons which essentially behave as links.
I'm doing this as sort of a self-initiated project, or bit of fun. ...
1
vote
2
answers
2k
views
DataTables search filter handler
I am writing a JavaScript feature where by I need to make a call to a third-party library (pre-1.10 DataTables) depending upon whether or not the user provides an integer as an input to the function ...
6
votes
2
answers
419
views
Window-scrolling controller
I generally feel that the pattern I use for development is kind of wrong. I start with simple functionality, then when I realize that some pieces can be reused I usually start to write "scope root ...
5
votes
3
answers
498
views
Similar event handlers for buttons
I have 3 simple similar event handler functions that I would like to refactor. Any suggestions?
...
13
votes
2
answers
837
views
Setting up radio button click ActionListeners
Instead of writing four almost identical setOnClickListener method calls, I opted to iterate over an array, but I'm wondering if this was the best way to do it. Do ...