Skip to content

Comments

multiple events example added#888

Closed
vitaly-zdanevich wants to merge 4 commits intojquery:masterfrom
vitaly-zdanevich:multiple-events
Closed

multiple events example added#888
vitaly-zdanevich wants to merge 4 commits intojquery:masterfrom
vitaly-zdanevich:multiple-events

Conversation

@vitaly-zdanevich
Copy link
Contributor

No description provided.

@AurelioDeRosa
Copy link
Member

@kswedberg Can you check the wording before I merge this PR? Thank you.

entries/on.xml Outdated
]]></code>
</example>
<example>
<desc>Also you can attach multiple events - for example this is usefull if you want to fire you function when user enter the mouse on some element and move out:</desc>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this description can be simplified quite a bit…
Attach multiple events—one on mouseenter and one on mouseleave to the same element:

entries/on.xml Outdated
<desc>Attach multiple events—one on mouseenter and one on mouseleave to the same element:</desc>
<code><![CDATA[
$( "#cart" ).on( "mouseenter mouseleave", function( event ) {
$( $this ).toggleClass("active");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$( $this ).toggleClass("active");

should be

$( this ).toggleClass( "active" );

@AurelioDeRosa
Copy link
Member

PR merged, thank you for the updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants