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
CSS3/JS/Flash版动画角标的实现与比较
Search
kaiye
April 18, 2012
Technology
0
130
CSS3/JS/Flash版动画角标的实现与比较
以动画角标的实现为例,探讨各种技术方案的优缺点。blog:
http://www.cnblogs.com/kaiye/archive/2012/04/06/3039043.html
kaiye
April 18, 2012
Tweet
Share
More Decks by kaiye
See All by kaiye
大话前端黑客
kaiye
4
310
前端七年之路
kaiye
8
400
拍拍首页2012版前端技术应用
kaiye
2
280
后IE6时代
kaiye
1
1.4k
GDD 2011 in Guangzhou
kaiye
0
1.8k
拍首2011前端技术分享
kaiye
1
180
Notification 3
kaiye
0
90
前端开发眼中的组件库
kaiye
3
380
Notification 2
kaiye
0
74
Other Decks in Technology
See All in Technology
ExaDB-XSで利用されているExadata Exascaleについて
oracle4engineer
PRO
3
270
役員・マネージャー・著者・エンジニアそれぞれの立場から見たAWS認定資格
nrinetcom
PRO
4
6.4k
"TEAM"を導入したら最高のエンジニア"Team"を実現できた / Deploying "TEAM" and Building the Best Engineering "Team"
yuj1osm
1
220
Охота на косуль у древних
ashapiro
0
110
開発者のための FinOps/FinOps for Engineers
oracle4engineer
PRO
1
130
OPENLOGI Company Profile
hr01
0
60k
リクルートのエンジニア組織を下支えする 新卒の育成の仕組み
recruitengineers
PRO
1
130
Visualize, Visualize, Visualize and rclone
tomoaki0705
9
83k
あなたが人生で成功するための5つの普遍的法則 #jawsug #jawsdays2025 / 20250301 HEROZ
yoshidashingo
2
310
フォーイット_エンジニア向け会社紹介資料_Forit_Company_Profile.pdf
forit_tech
1
1.7k
OCI Success Journey OCIの何が評価されてる?疑問に答える事例セミナー(2025年2月実施)
oracle4engineer
PRO
2
170
ディスプレイ広告(Yahoo!広告・LINE広告)におけるバックエンド開発
lycorptech_jp
PRO
0
470
Featured
See All Featured
Facilitating Awesome Meetings
lara
52
6.2k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
7
650
Producing Creativity
orderedlist
PRO
344
40k
Rails Girls Zürich Keynote
gr2m
94
13k
Mobile First: as difficult as doing things right
swwweet
223
9.5k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Product Roadmaps are Hard
iamctodd
PRO
50
11k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3k
Thoughts on Productivity
jonyablonski
69
4.5k
Reflections from 52 weeks, 52 projects
jeffersonlam
348
20k
Transcript
CSS3/JS/Flash版 动画角标的实现与比较 @kaiye
• 2008 - 2010 前端开发@支付宝 • 2010 - 至今 网页重构@ISUX
CSS3 Properties
CSS3 Animation http://css-tricks.com/examples/CSS3Clock/
CSS3 Animation http://designlovr.com/examples/ dynamic_stack_of_index_cards/
CSS3 Animation • http://www.paipai.com/caizuanjie.shtml • http://www.paipai.com/fangjia.shtml • chrome://flags/ enable Composited
render layer borders (合成渲染层边框)
CSS3动画角标 <css-selector>{ animation:<animation-name> <animation-duration> <animation-timing-function>; } @keyframes <animation-name>{ 0% {<css-declaration>}
100% {<css-declaration>} }
CSS3动画角标 .corner-ad-1:hover{animation: cornerad 0.3s step-start;} @keyframes cornerad{ 0% {background-position: right
0;} 33%{background-position: right -36px;} 67%{background-position: right -72px;} 100% {background-position: right -108px;} } http://yekai.net/demo/animation-corner-2.html
JS动画角标 http://yekai.net/demo/animation-corner-3.html
Flash动画角标 • Flash的参数设置 • getURL() http://yekai.net/demo/animation-corner-4.html
Flash动画角标 • Flash的参数设置 <embed src="corner.swf" pluginspage="http://www.macromedia.com/go/ getflashplayer" type="application/x-shockwave-flash" wmode="transparent" allowscriptaccess="always"
quality="high" width="120" height="120" FlashVars="url=http://t.qq.com/ weiweixiao&pic=http://t0.qlogo.cn/mbloghead/ ce1dbda08969ddd2a5ea/ 120&callback=closeCornerAd" ></embed> 若变量值含有&符号,需转义为%26
Flash动画角标 • getURL()
动画角标方案比较 方案 实现成本 复用成本 兼容性 CSS 低 低 IE6/7 CSS3
中 中 Safari/Chrome/ Firefox/IE10 JS 高 低 !noscript Flash 高 低 Flash Player/!iOS
None
while(兼容性 && 实现成本){ do(); }
while(兼容性 && 实现成本){ do(); } var 兼容性 = this.兼容性 ;
IE && !IE • HTML5/CSS3 • http://sofish.de/1819 • http://pb.paipaioa.com •
IE • CSS Attributes • Introduction to Dynamic HTML • ActiveX
Reference • http://findmebyip.com/litmus/ • http://www.qianduan.net/47-amazing-css3- animation.html • http://www.5uflash.com/flashjiaocheng/ Flashyuweb/3173.html
谢谢