SlideShare a Scribd company logo
1 of 26
Unit 2: jQuery
Lesson 5: Identifying Events
October 7, 2013
Lesson 5: Identifying Events
Introduction
to jQuery

Syntax and
Structure

Abstraction

Events

Lesson 1

Lesson 2

Lesson 3

Lesson 4

TBD

Effects

Tying It
Together

Identifying
Events

Lesson 8

Lesson 7

Lesson 6

Lesson 5

TBD

TBD

TBD

TBD

Lesson 9

Lesson 10

Lesson 11

Lesson 12

2
Recap from last time (I)
• An event is any action that a user takes on a web page, such as:
• Double-clicking on a button
• Single-clicking on a button
• Hovering the mouse over an image
Effect

Event
If user

double-clicks on a button,

then

turn the text background color red

If user

single-clicks on a button

then

turn the text background color red

If user

hovers over the image

then

turn the text background color red
3
Recap from last time (II)
• jQuery makes it easy for us to use different events
• If we change our minds and want to trigger the effect based on a
different event, all we need to do is swap out our line of jQuery
event code
$(document).ready(function() {

$(‘#button’).dblclick(function() {

$(p).css(“background-color”:
“red”);
});
});

4
Recap from last time (III)
• jQuery makes it easy for us to use different events
• If we change our minds and want to trigger the effect based on a
different event, all we need to do is swap out our line of jQuery
event code
$(document).ready(function() {

$(‘#button’).dblclick(function() {

$(document).ready(function() {

$(‘#button).click(function() {

$(p).css(“background-color”:
“red”);
});
});

$(p).css(“background-color”:
“red”);
});
});

5
Events are triggered more often than you think
• Whenever you search on Google, look to buy something on
Amazon, or scroll through your Facebook News Feed, you are
probably triggering events
• Events play an important role in creating a rich user experience
and so they appear on every interactive page—or almost all the
websites you regularly visit

Google

Amazon

Facebook
6
Example: Google search (I)
• Let’s navigate to www.google.com to see some examples of how
events are used on the web

7
Example: Google search (II)
Event #1: Click in the search bar
• Do you notice any change?

8
Example: Google search (III)
Event #1: Click in the search bar
Clicking in the search bar
triggers the border to turn blue

9
Example: Google search (IV)
Event #2: Hover the cursor over the “I’m Feeling Lucky” button
• See any difference?

10
Example: Google search (V)

Hovering over the button triggers the text to
change to “I’m Feeling Artistic”

11
Exercise: Creating a Google Account (I)
• Go to https://accounts.google.com/SignUp
• How many different events can you identify?

12
Exercise: Creating a Google Account (II)
1
1. Hovering the cursor over a text field triggers the border to
become dark grey

1

13
Exercise: Creating a Google Account (III)
1
1. Hovering the cursor over a text field triggers the border to turn
dark grey
2
2. Clicking in the text field triggers the border to turn blue

1

2

14
Exercise: Creating a Google Account (IV)
3
1. Hovering the cursor over the link triggers the text to become
underlined

3

15
Exercise: Creating a Google Account (V)
3
1. Hovering the cursor over the link triggers the text to become
underlined
4
2. Clicking in certain text fields triggers a dialog box to appear

3

4

16
Exercise: Creating a Google Account (VI)
5
1. Clicking out of an empty text field triggers the border to turn red
and causes an alert message to appear

5

17
Exercise: Creating a Google Account (VII)
5
1. Clicking out of an empty text field triggers the border to turn red
and causes an alert message to appear
6
2. Typing inside the password field triggers a meter to evaluate the
strength of your password
5

6

18
Exercise: Creating a Google Account (VIII)
•

There are many other events you might have found, such as:
•

Hovering the cursor over a selection in the dropdown menu
triggers the selection’s background to turn grey

•

Hovering the cursor over the flag icon triggers the flag’s
background to turn grey

19
Exercise: Creating a Google Account (IX)
•

There are many other events you might have found, such as:
•

Hovering the cursor over a selection in the dropdown menu
triggers the selection’s background to turn grey

•

Hovering the cursor over the flag icon triggers the flag’s
background to turn grey

Websites use events to make tasks as basic as
filling out a form become as seamless as possible
20
Every event that can be triggered has its
corresponding jQuery code (I)
Event

jQuery

• Text field is selected

• .focusin()

• Cursor hovers over an element

• .hover()

• Click on an element

• .click()

21
Every event that can be triggered has its
corresponding jQuery code (II)
Event

jQuery

• Text field is selected

• .focusin()

• Cursor hovers over an element

• .hover()

• Click on an element

• .click()

• Double-click on an element

• .dblclick()

• Press down on a key

• .keydown()

• Release a pressed key

• .keyup()

22
Every event that can be triggered has its
corresponding jQuery code (III)
Event

jQuery

• Text field is selected

• .focusin()

• Cursor hovers over an element

• .hover()

• Click on an element

• .click()

• Double-click on an element

• .dblclick()

• Press down on a key

• .keydown()

• Release a pressed key
.
.
.

• .keyup()
.
.
.

• There are many, many more!
23
Summary (I)
• Whenever you search on Google, look to buy something on
Amazon, or scroll through your Facebook News Feed, you are
probably triggering events
• Events play an important role in creating a rich user experience
and so they appear on every interactive page—or almost all the
websites you regularly visit

Google

Amazon

Facebook
24
Summary (II)
• Websites use events to make tasks as basic as filling out a form
become as seamless as possible!

Clicking in the text field triggers the
border to turn blue
Clicking out of an empty text field
triggers the border to turn red and
causes an alert message to appear

25
What to do on your own
1. Go to URL to complete the Codecademy course online

2. Do the practice set on the material learned

1. Take the follow-up quiz to test your understanding

26

More Related Content

Similar to Lesson 205 07 oct13-1500-ay

DHTML - Events & Buttons
DHTML - Events  & ButtonsDHTML - Events  & Buttons
DHTML - Events & ButtonsDeep Patel
 
Goombal Quick Start User Guide Jan 2016
Goombal Quick Start User Guide  Jan 2016Goombal Quick Start User Guide  Jan 2016
Goombal Quick Start User Guide Jan 2016GoombalShare
 
How to Create a Presentation Using Google Slides
How to Create a Presentation Using Google SlidesHow to Create a Presentation Using Google Slides
How to Create a Presentation Using Google SlidesAngie Lee
 
Google WorkShop for STC LoneStar Chapter
Google WorkShop for STC LoneStar ChapterGoogle WorkShop for STC LoneStar Chapter
Google WorkShop for STC LoneStar ChapterChristopher Ward
 
06 win forms
06 win forms06 win forms
06 win formsmrjw
 
Web app with j query & javascript (5:4)
Web app with j query & javascript (5:4)Web app with j query & javascript (5:4)
Web app with j query & javascript (5:4)Thinkful
 
Lesson 207 19 oct13-1500-ay
Lesson 207 19 oct13-1500-ayLesson 207 19 oct13-1500-ay
Lesson 207 19 oct13-1500-ayCodecademy Ren
 
Testing Web Applications Through User Interface Constraints (CASCON 2015 Talk)
Testing Web Applications Through User Interface Constraints (CASCON 2015 Talk)Testing Web Applications Through User Interface Constraints (CASCON 2015 Talk)
Testing Web Applications Through User Interface Constraints (CASCON 2015 Talk)Sylvain Hallé
 
Introj Query Pt2
Introj Query Pt2Introj Query Pt2
Introj Query Pt2kshyju
 
Build a Web App with JavaScript and jQuery (5:18:17, Los Angeles)
Build a Web App with JavaScript and jQuery (5:18:17, Los Angeles)Build a Web App with JavaScript and jQuery (5:18:17, Los Angeles)
Build a Web App with JavaScript and jQuery (5:18:17, Los Angeles)Thinkful
 
Startup DNA: the formula behind successful startups in Silicon Valley (update...
Startup DNA: the formula behind successful startups in Silicon Valley (update...Startup DNA: the formula behind successful startups in Silicon Valley (update...
Startup DNA: the formula behind successful startups in Silicon Valley (update...Yevgeniy Brikman
 
The Fine Art of JavaScript Event Handling
The Fine Art of JavaScript Event HandlingThe Fine Art of JavaScript Event Handling
The Fine Art of JavaScript Event HandlingYorick Phoenix
 
[Droidcon NL 2013] Developing Cross-Platform Apps
[Droidcon NL 2013] Developing Cross-Platform Apps[Droidcon NL 2013] Developing Cross-Platform Apps
[Droidcon NL 2013] Developing Cross-Platform AppsKenichi Kambara
 
Coding Flash : ActionScript(3.0) Tutorial
Coding Flash :  ActionScript(3.0) TutorialCoding Flash :  ActionScript(3.0) Tutorial
Coding Flash : ActionScript(3.0) TutorialPEI-YAO HUNG
 
Windows Forms For Beginners Part - 4
Windows Forms For Beginners Part - 4Windows Forms For Beginners Part - 4
Windows Forms For Beginners Part - 4Bhushan Mulmule
 
User first! 前端的最後一塊拼圖
User first! 前端的最後一塊拼圖User first! 前端的最後一塊拼圖
User first! 前端的最後一塊拼圖Maxis Kao
 
Solving Problems with YUI3: AutoComplete
Solving Problems with YUI3: AutoCompleteSolving Problems with YUI3: AutoComplete
Solving Problems with YUI3: AutoCompleteIsaacSchlueter
 
3.4 events and interactivity
3.4   events and interactivity3.4   events and interactivity
3.4 events and interactivityallenbailey
 

Similar to Lesson 205 07 oct13-1500-ay (20)

DHTML - Events & Buttons
DHTML - Events  & ButtonsDHTML - Events  & Buttons
DHTML - Events & Buttons
 
Goombal Quick Start User Guide Jan 2016
Goombal Quick Start User Guide  Jan 2016Goombal Quick Start User Guide  Jan 2016
Goombal Quick Start User Guide Jan 2016
 
How to Create a Presentation Using Google Slides
How to Create a Presentation Using Google SlidesHow to Create a Presentation Using Google Slides
How to Create a Presentation Using Google Slides
 
Google WorkShop for STC LoneStar Chapter
Google WorkShop for STC LoneStar ChapterGoogle WorkShop for STC LoneStar Chapter
Google WorkShop for STC LoneStar Chapter
 
06 win forms
06 win forms06 win forms
06 win forms
 
Web app with j query & javascript (5:4)
Web app with j query & javascript (5:4)Web app with j query & javascript (5:4)
Web app with j query & javascript (5:4)
 
Lesson 207 19 oct13-1500-ay
Lesson 207 19 oct13-1500-ayLesson 207 19 oct13-1500-ay
Lesson 207 19 oct13-1500-ay
 
Testing Web Applications Through User Interface Constraints (CASCON 2015 Talk)
Testing Web Applications Through User Interface Constraints (CASCON 2015 Talk)Testing Web Applications Through User Interface Constraints (CASCON 2015 Talk)
Testing Web Applications Through User Interface Constraints (CASCON 2015 Talk)
 
Introj Query Pt2
Introj Query Pt2Introj Query Pt2
Introj Query Pt2
 
Build a Web App with JavaScript and jQuery (5:18:17, Los Angeles)
Build a Web App with JavaScript and jQuery (5:18:17, Los Angeles)Build a Web App with JavaScript and jQuery (5:18:17, Los Angeles)
Build a Web App with JavaScript and jQuery (5:18:17, Los Angeles)
 
Startup DNA: the formula behind successful startups in Silicon Valley (update...
Startup DNA: the formula behind successful startups in Silicon Valley (update...Startup DNA: the formula behind successful startups in Silicon Valley (update...
Startup DNA: the formula behind successful startups in Silicon Valley (update...
 
C++ windows
C++ windowsC++ windows
C++ windows
 
The Fine Art of JavaScript Event Handling
The Fine Art of JavaScript Event HandlingThe Fine Art of JavaScript Event Handling
The Fine Art of JavaScript Event Handling
 
[Droidcon NL 2013] Developing Cross-Platform Apps
[Droidcon NL 2013] Developing Cross-Platform Apps[Droidcon NL 2013] Developing Cross-Platform Apps
[Droidcon NL 2013] Developing Cross-Platform Apps
 
Coding Flash : ActionScript(3.0) Tutorial
Coding Flash :  ActionScript(3.0) TutorialCoding Flash :  ActionScript(3.0) Tutorial
Coding Flash : ActionScript(3.0) Tutorial
 
Windows Forms For Beginners Part - 4
Windows Forms For Beginners Part - 4Windows Forms For Beginners Part - 4
Windows Forms For Beginners Part - 4
 
Android App development III
Android App development IIIAndroid App development III
Android App development III
 
User first! 前端的最後一塊拼圖
User first! 前端的最後一塊拼圖User first! 前端的最後一塊拼圖
User first! 前端的最後一塊拼圖
 
Solving Problems with YUI3: AutoComplete
Solving Problems with YUI3: AutoCompleteSolving Problems with YUI3: AutoComplete
Solving Problems with YUI3: AutoComplete
 
3.4 events and interactivity
3.4   events and interactivity3.4   events and interactivity
3.4 events and interactivity
 

More from Codecademy Ren

Lesson 304 05 jan14-1500-ay
Lesson 304 05 jan14-1500-ayLesson 304 05 jan14-1500-ay
Lesson 304 05 jan14-1500-ayCodecademy Ren
 
Lesson 301 26 nov13-1500-ay
Lesson 301 26 nov13-1500-ayLesson 301 26 nov13-1500-ay
Lesson 301 26 nov13-1500-ayCodecademy Ren
 
Lesson 302 05 jan14-1500-ay
Lesson 302 05 jan14-1500-ayLesson 302 05 jan14-1500-ay
Lesson 302 05 jan14-1500-ayCodecademy Ren
 
Lesson 206 11 oct13-1500-ay
Lesson 206 11 oct13-1500-ayLesson 206 11 oct13-1500-ay
Lesson 206 11 oct13-1500-ayCodecademy Ren
 
Lesson 202 02 oct13-1800-ay
Lesson 202 02 oct13-1800-ayLesson 202 02 oct13-1800-ay
Lesson 202 02 oct13-1800-ayCodecademy Ren
 
Lesson 112 24 aug13-2300-ay
Lesson 112 24 aug13-2300-ayLesson 112 24 aug13-2300-ay
Lesson 112 24 aug13-2300-ayCodecademy Ren
 
Lesson 108 23 aug13-1430-ay
Lesson 108 23 aug13-1430-ayLesson 108 23 aug13-1430-ay
Lesson 108 23 aug13-1430-ayCodecademy Ren
 
Lesson 106 23 aug13-1430-ay
Lesson 106 23 aug13-1430-ayLesson 106 23 aug13-1430-ay
Lesson 106 23 aug13-1430-ayCodecademy Ren
 
Lesson 105 23 aug13-1430-ay
Lesson 105 23 aug13-1430-ayLesson 105 23 aug13-1430-ay
Lesson 105 23 aug13-1430-ayCodecademy Ren
 
Lesson 101 23 aug13-1430-ay
Lesson 101 23 aug13-1430-ayLesson 101 23 aug13-1430-ay
Lesson 101 23 aug13-1430-ayCodecademy Ren
 
Lesson 102 25 aug13-2200-ay
Lesson 102 25 aug13-2200-ayLesson 102 25 aug13-2200-ay
Lesson 102 25 aug13-2200-ayCodecademy Ren
 
Lesson 103 23 aug13-1430-ay
Lesson 103 23 aug13-1430-ayLesson 103 23 aug13-1430-ay
Lesson 103 23 aug13-1430-ayCodecademy Ren
 
Lesson 104 23 aug13-1430-ay
Lesson 104 23 aug13-1430-ayLesson 104 23 aug13-1430-ay
Lesson 104 23 aug13-1430-ayCodecademy Ren
 
Lesson 111 24 aug13-1430-ay
Lesson 111 24 aug13-1430-ayLesson 111 24 aug13-1430-ay
Lesson 111 24 aug13-1430-ayCodecademy Ren
 

More from Codecademy Ren (14)

Lesson 304 05 jan14-1500-ay
Lesson 304 05 jan14-1500-ayLesson 304 05 jan14-1500-ay
Lesson 304 05 jan14-1500-ay
 
Lesson 301 26 nov13-1500-ay
Lesson 301 26 nov13-1500-ayLesson 301 26 nov13-1500-ay
Lesson 301 26 nov13-1500-ay
 
Lesson 302 05 jan14-1500-ay
Lesson 302 05 jan14-1500-ayLesson 302 05 jan14-1500-ay
Lesson 302 05 jan14-1500-ay
 
Lesson 206 11 oct13-1500-ay
Lesson 206 11 oct13-1500-ayLesson 206 11 oct13-1500-ay
Lesson 206 11 oct13-1500-ay
 
Lesson 202 02 oct13-1800-ay
Lesson 202 02 oct13-1800-ayLesson 202 02 oct13-1800-ay
Lesson 202 02 oct13-1800-ay
 
Lesson 112 24 aug13-2300-ay
Lesson 112 24 aug13-2300-ayLesson 112 24 aug13-2300-ay
Lesson 112 24 aug13-2300-ay
 
Lesson 108 23 aug13-1430-ay
Lesson 108 23 aug13-1430-ayLesson 108 23 aug13-1430-ay
Lesson 108 23 aug13-1430-ay
 
Lesson 106 23 aug13-1430-ay
Lesson 106 23 aug13-1430-ayLesson 106 23 aug13-1430-ay
Lesson 106 23 aug13-1430-ay
 
Lesson 105 23 aug13-1430-ay
Lesson 105 23 aug13-1430-ayLesson 105 23 aug13-1430-ay
Lesson 105 23 aug13-1430-ay
 
Lesson 101 23 aug13-1430-ay
Lesson 101 23 aug13-1430-ayLesson 101 23 aug13-1430-ay
Lesson 101 23 aug13-1430-ay
 
Lesson 102 25 aug13-2200-ay
Lesson 102 25 aug13-2200-ayLesson 102 25 aug13-2200-ay
Lesson 102 25 aug13-2200-ay
 
Lesson 103 23 aug13-1430-ay
Lesson 103 23 aug13-1430-ayLesson 103 23 aug13-1430-ay
Lesson 103 23 aug13-1430-ay
 
Lesson 104 23 aug13-1430-ay
Lesson 104 23 aug13-1430-ayLesson 104 23 aug13-1430-ay
Lesson 104 23 aug13-1430-ay
 
Lesson 111 24 aug13-1430-ay
Lesson 111 24 aug13-1430-ayLesson 111 24 aug13-1430-ay
Lesson 111 24 aug13-1430-ay
 

Recently uploaded

Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 

Recently uploaded (20)

Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 

Lesson 205 07 oct13-1500-ay

  • 1. Unit 2: jQuery Lesson 5: Identifying Events October 7, 2013
  • 2. Lesson 5: Identifying Events Introduction to jQuery Syntax and Structure Abstraction Events Lesson 1 Lesson 2 Lesson 3 Lesson 4 TBD Effects Tying It Together Identifying Events Lesson 8 Lesson 7 Lesson 6 Lesson 5 TBD TBD TBD TBD Lesson 9 Lesson 10 Lesson 11 Lesson 12 2
  • 3. Recap from last time (I) • An event is any action that a user takes on a web page, such as: • Double-clicking on a button • Single-clicking on a button • Hovering the mouse over an image Effect Event If user double-clicks on a button, then turn the text background color red If user single-clicks on a button then turn the text background color red If user hovers over the image then turn the text background color red 3
  • 4. Recap from last time (II) • jQuery makes it easy for us to use different events • If we change our minds and want to trigger the effect based on a different event, all we need to do is swap out our line of jQuery event code $(document).ready(function() { $(‘#button’).dblclick(function() { $(p).css(“background-color”: “red”); }); }); 4
  • 5. Recap from last time (III) • jQuery makes it easy for us to use different events • If we change our minds and want to trigger the effect based on a different event, all we need to do is swap out our line of jQuery event code $(document).ready(function() { $(‘#button’).dblclick(function() { $(document).ready(function() { $(‘#button).click(function() { $(p).css(“background-color”: “red”); }); }); $(p).css(“background-color”: “red”); }); }); 5
  • 6. Events are triggered more often than you think • Whenever you search on Google, look to buy something on Amazon, or scroll through your Facebook News Feed, you are probably triggering events • Events play an important role in creating a rich user experience and so they appear on every interactive page—or almost all the websites you regularly visit Google Amazon Facebook 6
  • 7. Example: Google search (I) • Let’s navigate to www.google.com to see some examples of how events are used on the web 7
  • 8. Example: Google search (II) Event #1: Click in the search bar • Do you notice any change? 8
  • 9. Example: Google search (III) Event #1: Click in the search bar Clicking in the search bar triggers the border to turn blue 9
  • 10. Example: Google search (IV) Event #2: Hover the cursor over the “I’m Feeling Lucky” button • See any difference? 10
  • 11. Example: Google search (V) Hovering over the button triggers the text to change to “I’m Feeling Artistic” 11
  • 12. Exercise: Creating a Google Account (I) • Go to https://accounts.google.com/SignUp • How many different events can you identify? 12
  • 13. Exercise: Creating a Google Account (II) 1 1. Hovering the cursor over a text field triggers the border to become dark grey 1 13
  • 14. Exercise: Creating a Google Account (III) 1 1. Hovering the cursor over a text field triggers the border to turn dark grey 2 2. Clicking in the text field triggers the border to turn blue 1 2 14
  • 15. Exercise: Creating a Google Account (IV) 3 1. Hovering the cursor over the link triggers the text to become underlined 3 15
  • 16. Exercise: Creating a Google Account (V) 3 1. Hovering the cursor over the link triggers the text to become underlined 4 2. Clicking in certain text fields triggers a dialog box to appear 3 4 16
  • 17. Exercise: Creating a Google Account (VI) 5 1. Clicking out of an empty text field triggers the border to turn red and causes an alert message to appear 5 17
  • 18. Exercise: Creating a Google Account (VII) 5 1. Clicking out of an empty text field triggers the border to turn red and causes an alert message to appear 6 2. Typing inside the password field triggers a meter to evaluate the strength of your password 5 6 18
  • 19. Exercise: Creating a Google Account (VIII) • There are many other events you might have found, such as: • Hovering the cursor over a selection in the dropdown menu triggers the selection’s background to turn grey • Hovering the cursor over the flag icon triggers the flag’s background to turn grey 19
  • 20. Exercise: Creating a Google Account (IX) • There are many other events you might have found, such as: • Hovering the cursor over a selection in the dropdown menu triggers the selection’s background to turn grey • Hovering the cursor over the flag icon triggers the flag’s background to turn grey Websites use events to make tasks as basic as filling out a form become as seamless as possible 20
  • 21. Every event that can be triggered has its corresponding jQuery code (I) Event jQuery • Text field is selected • .focusin() • Cursor hovers over an element • .hover() • Click on an element • .click() 21
  • 22. Every event that can be triggered has its corresponding jQuery code (II) Event jQuery • Text field is selected • .focusin() • Cursor hovers over an element • .hover() • Click on an element • .click() • Double-click on an element • .dblclick() • Press down on a key • .keydown() • Release a pressed key • .keyup() 22
  • 23. Every event that can be triggered has its corresponding jQuery code (III) Event jQuery • Text field is selected • .focusin() • Cursor hovers over an element • .hover() • Click on an element • .click() • Double-click on an element • .dblclick() • Press down on a key • .keydown() • Release a pressed key . . . • .keyup() . . . • There are many, many more! 23
  • 24. Summary (I) • Whenever you search on Google, look to buy something on Amazon, or scroll through your Facebook News Feed, you are probably triggering events • Events play an important role in creating a rich user experience and so they appear on every interactive page—or almost all the websites you regularly visit Google Amazon Facebook 24
  • 25. Summary (II) • Websites use events to make tasks as basic as filling out a form become as seamless as possible! Clicking in the text field triggers the border to turn blue Clicking out of an empty text field triggers the border to turn red and causes an alert message to appear 25
  • 26. What to do on your own 1. Go to URL to complete the Codecademy course online 2. Do the practice set on the material learned 1. Take the follow-up quiz to test your understanding 26