learn.jquery.com icon indicating copy to clipboard operation
learn.jquery.com copied to clipboard

Events / Event Helpers Page needs a overhaul

Open RedWolves opened this issue 11 years ago • 5 comments

https://learn.jquery.com/events/event-helpers/

After we removed the .toggle() event helper in gh-529 the page is pretty sparse and could use a bit more help.

Let's discuss at the next content meeting.

RedWolves avatar Jan 08 '15 04:01 RedWolves

IMHO, things worth mentioning in that article:

  • The special change event, however the current explanation can better.
  • event.which, event.target, event.timeStamp, ...
  • stopPropagation() and stopImmediatePropagation(), the difference between them.

I could take a few of those, if you like.

arthurvr avatar Jan 08 '15 06:01 arthurvr

We don't recommend using shorthand methods but can't remove them, so I'd prefer we just teach .on() for attaching events.

dmethvin avatar Jan 08 '15 13:01 dmethvin

Actually, the .hover() method is best avoided as well because it's not really hover. It's just a shorthand for mouseenter/leave.

dmethvin avatar Jan 08 '15 13:01 dmethvin

Actually, the .hover() method is best avoided as well because it's not really hover. It's just a shorthand for mouseenter/leave.

Well, let's remove the current section on .hover() and include this explanation.

arthurvr avatar Jan 08 '15 16:01 arthurvr

Perhaps just mention that .hover() and the event shortcut methods are archaic ones that are best not used on modern code? That is, you may see them around but don't use them yourself. Kind of like .bind(), .delegate() etc. today, still supported but not recommended.

dmethvin avatar Jan 08 '15 19:01 dmethvin