-
Notifications
You must be signed in to change notification settings - Fork 480
Make the example more concrete #534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
As a student, I want to copy/paste the example and try it. By adding a definition of the CSS for the on and off class, and by adding text which can be clicked on, the example becomes easily runnable.
@@ -55,10 +60,10 @@ $( ".switch, .clapper" ).click(function() { | |||
}); | |||
``` | |||
|
|||
With custom events, your code might look more like this: | |||
With custom events, we can define our own events. Then your code might look more like this: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer we reword this a bit more and also stuck with the shorter changeState
:
We can instead use a custom event, like
changeState
and our code would look more like this:
If you're still interested in seeing this change through, could you look at my suggestions. Otherwise I'll probably make the changes myself in a few weeks. |
@githubshrek Could you include your real name in your git config? |
OK, added my real name. |
<style> | ||
.on { background-color: yellow; } | ||
.off { background-color: black; color: white; } | ||
</style> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let us handle this together with #535.
As a student, I want to copy/paste the example and try it. By adding a definition of the CSS for the on and off class, and by adding text which can be clicked on, the example becomes easily runnable. Also, by choosing a more obviously non-standard event name like "changeTheLightState", then it is clearer to the student that this is something custom.