Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
jQuery Basic
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Ryan Chung
March 14, 2020
Programming
230
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
jQuery Basic
Ryan Chung
March 14, 2020
More Decks by Ryan Chung
See All by Ryan Chung
MovieBot Development
ryan403
0
330
Design Voice-First Games for Alexa
ryan403
0
88
AI Teaching Talk
ryan403
0
150
Cognitive Service
ryan403
0
120
jQuery & API Practices
ryan403
0
160
CSS Practices
ryan403
1
180
JavaScript Practices
ryan403
0
110
Web Programming - Lesson 6
ryan403
1
670
Web Programming - Lesson 7
ryan403
1
660
Other Decks in Programming
See All in Programming
symfony/aiとlaravel/boost
77web
0
110
Mujeres en SEO Summit 2026 - Greatest Disaster Hits en Web Performance
guaca
0
220
AI がコードを書く時代における新卒エンジニアの仕事風景 (2026) / New Graduate Engineers in the Era of AI Coding (2026)
sushichan044
0
170
jQueryをバージョンアップする前に使いたいjQuery Migrate
matsuo_atsushi
0
620
ランチタイムLT会3周年!ランチタイムLT会を3年間続けられたお話
y0hgi
1
120
フロントエンドとバックエンドで「1文字」を揃えよう
youkidearitai
PRO
0
770
そのテスト、説明できますか?~LWテスト戦略FW~のご紹介
nakahara
0
180
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
3.4k
Go1.27で導入されるジェネリクスメソッドでできること
mackee
0
220
AIで効率化できた業務・日常
ochtum
0
160
はてなアカウント基盤 State of the Union
cockscomb
1
1.2k
SREは、MCPとSRE Agentをこう使え!
kazumax55
0
130
Featured
See All Featured
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
170
Designing Experiences People Love
moore
143
24k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
250
ラッコキーワード サービス紹介資料
rakko
1
3.8M
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
1
360
First, design no harm
axbom
PRO
2
1.2k
Leo the Paperboy
mayatellez
7
1.9k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.2k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
180
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
790
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.9k
Designing for humans not robots
tammielis
254
26k
Transcript
jQuery Basic –
[email protected]
行動開發學院 行動開發學院 jQuery Basic Ryan Chung
1
jQuery Basic –
[email protected]
行動開發學院 行動開發學院 課程大綱 • 簡介 (jQuery是什麼
/ 目的 / 主要功能) • 開始使用 (如何下載 / 放在哪裡) • 文法結構 (識別符/選擇器/動作) • 選擇器與事件 – Lab : 按按鈕看詳細介紹 • HTML與CSS操作 – Lab : 畫面特效應用 – Lab : 滑過照片秀名子 – Lab : 馬利兄弟闖關 • 元件巡訪 • jQuery AJAX 應用 • 綜合範例 2
jQuery Basic –
[email protected]
行動開發學院 行動開發學院 簡介 • JavaScript Library
• 簡化JavaScript程式碼 3
jQuery Basic –
[email protected]
行動開發學院 行動開發學院 主要功能 • HTML/DOM 存取
• CSS 使用 • HTML事件方法 • 特效與動畫 • AJAX • 其他工具 4
jQuery Basic –
[email protected]
行動開發學院 行動開發學院 如何使用 1. 在官網找到最新版本下載 https://code.jquery.com/jquery-X.X.X.min.js
2. 在<head></head>中插入 <script src="jquery-X.X.X.min.js"></script> 5
jQuery Basic –
[email protected]
行動開發學院 行動開發學院 文法結構 • $(selector).action() 選擇對象(找到誰)
. 進行動作(做什麼) • 例如: $(this).hide() 把目前這個元件藏起來 $("p").hide() 把所有段落藏起來 $(".test").hide() 把所有類別為test的元件藏起來 $("#test").hide() 把所有id為test的元件藏起來 6
jQuery Basic –
[email protected]
行動開發學院 行動開發學院 避免jQuery存取到還沒載入的元件 7
jQuery Basic –
[email protected]
行動開發學院 行動開發學院 選擇器 selector • element
selector $("p")、$("button") • #id selector $("#test") • .class selector $(".test") 8
jQuery Basic –
[email protected]
行動開發學院 行動開發學院 常見事件偵測 • click、dblclick $("p").click(
function(){ // action goes here!! }); • ready • mouseenter,mouseleave,mousedown,mous eup • hover = mouseenter+mouseleave • focus, blur 9
jQuery Basic –
[email protected]
行動開發學院 行動開發學院 效果 • hide() 隱藏
• show() 顯示 • toggle() 切換隱藏或顯示 • fadeIn() 淡入 • fadeOut() 淡出 • fadeToggle() 切換淡入與淡出 • fadeTo() 改變透明度 • slideDown() 下拉顯示 • slideUp() 上拉隱藏 • slideToggle() • animate() 動畫 10
jQuery Basic –
[email protected]
行動開發學院 行動開發學院 Lab.按按鈕看詳細介紹 按按鈕可以顯示詳細介紹 再按一下可以隱藏詳細介紹 11
jQuery Basic –
[email protected]
行動開發學院 行動開發學院 index.html 12
jQuery Basic –
[email protected]
行動開發學院 行動開發學院 main.js 13
jQuery Basic –
[email protected]
行動開發學院 行動開發學院 Lab.顯示/隱藏 ->各種特效 1. 請試著修改顯示/隱藏的範例,變成淡入淡出特效
• fadeToggle() 2. 請試著修改顯示/隱藏的範例,變成下拉上收特效 • slideToggle() 3. 請測試帶有參數的顯示效果 14
jQuery Basic –
[email protected]
行動開發學院 行動開發學院 Lab.滑鼠移到誰,就顯示誰的名字 15
jQuery Basic –
[email protected]
行動開發學院 行動開發學院 滑鼠移到誰,就顯示誰的名字 • 用陣列儲存每一個人的名字 •
當網頁元件準備好時 • 當滑鼠移至圖片上面時 • hover吃兩個參數 • 進入範圍 • 取得是第幾張圖片,對應取得人名 • 利用text(),改變段落中的文字 • 離開範圍 • 清空文字 16
jQuery Basic –
[email protected]
行動開發學院 行動開發學院 index.html 17
jQuery Basic –
[email protected]
行動開發學院 行動開發學院 main.js 18
jQuery Basic –
[email protected]
行動開發學院 行動開發學院 index() 19
jQuery Basic –
[email protected]
行動開發學院 行動開發學院 animate() 動畫 • 改變元件的屬性
• 位置 • 透明度 • 大小(寬度、高度) • 各種CSS樣式 20
jQuery Basic –
[email protected]
行動開發學院 行動開發學院 Lab.瑪莉兄弟闖關 • 按下鍵盤右鍵,移動瑪莉兄弟闖關 21
jQuery Basic –
[email protected]
行動開發學院 行動開發學院 index.html 22
jQuery Basic –
[email protected]
行動開發學院 行動開發學院 style.css 23
jQuery Basic –
[email protected]
行動開發學院 行動開發學院 main.js 24