Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
position: fixed;を上手に飼う方法
Search
usagi-f
February 21, 2015
Programming
380
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
position: fixed;を上手に飼う方法
usagi-f
February 21, 2015
More Decks by usagi-f
See All by usagi-f
フロントエンド実装から見たAtomic Design開発のポイント
usagif
3
7k
Take into Accessibility in React
usagif
1
730
platoを使ったコードメトリクス生成
usagif
0
320
How Github works and How Google works
usagif
0
140
良いUIをエンジニアに作ってもらうために、デザイナーができること
usagif
1
88
DMMで新規サービス作ったらフロントエンドエンジニアの重要性が浮き彫りになった話 - DMM Study night
usagif
0
120
Frontend summary in 2015 summer
usagif
0
59
なるべく噛み砕いたGit基礎講習
usagif
1
89
Other Decks in Programming
See All in Programming
Optunaを作ったときにやりたかったこと、その後 (2026/10/16, Optuna Meetup #3)
iwiwi
1
300
The Rails Doctrine Decade
koic
2
570
全ての永続トークンを、生まれる前に消し去りたい!
sylph01
2
400
Railsのためのパスキー実践入門 〜マルチテナントSaaSでの意思決定〜
utakaha
0
150
Simple Storage Service(S3) is not simple
iwatsukayura
0
280
気持ちぃ〜角丸 Squircle
ryu1013
0
290
dotNET_vulnclicker_intro.pdf
deka_morita
0
140
[ハンズオン]AIへの指示だけで「五目並べ」を作ってみよう
satoshi256kbyte
1
370
golang-bob.pdf
iwatsukayura
0
130
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
5
5.1k
コードレビューのボトルネックを"する側"と"される側"の両面から解消する
yub0n
2
1.6k
Compiling a real-world CLI tool to native with Static Hermes
tmikov2023
0
110
Featured
See All Featured
Game over? The fight for quality and originality in the time of robots
wayneb77
1
300
Building AI with AI
inesmontani
PRO
1
1.3k
For a Future-Friendly Web
brad_frost
184
10k
Done Done
chrislema
187
17k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
270
The Cult of Friendly URLs
andyhume
79
7k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
800
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.8k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
Crafting Experiences
bethany
1
380
Practical Orchestrator
shlominoach
192
12k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
450
Transcript
position: fixed;を上手に飼う方法 2015.02.21 Frontrend Conference DMM.com Labo 石橋啓太
DMM.com Labo デザイナー ! 昔はバナーとか作ってたけど、 フロントエンド技術に興味がでてきた人。 ! コーダーだったり、UI考えたり、アプリ作ったり。 ! 最近AngularJSいじくってます。
石橋 啓太 ishibashi keita
固定表示の実装でハマったこと ありますか?
固定表示の実装でハマったこと ありますか? あるある
かわいいアイツ UETQNN UETQNN fixed fixed
自由自在に扱えるように fixedについてもっと知ろう! !
position: fixed;の中身
position: fixed;の中身 absoluteと同じ絶対配置 基準にするのはviewport
.red { position: fixed; left: 0; bottom: 0; width: 100%;
} position: fixed;の中身 fixed 基準値:viewport UETQNN body div
position: fixed;の中身 やってること 大体おなじ なーんだ。
viewportってなんだっけ あー、知ってる知ってる。 アレでしょ?アレ。
PC ウィンドウエリア=viewport viewportってなんだっけ
スマホ ウィンドウ……? viewportってなんだっけ
visual viewport layout viewport 実際の表示領域(ズーム時含む) metaタグによって設定される ズームした時の挙動について デバイス・OS毎に大きく異なるので ピンチイン許可する場合は要注意! !
スマホ viewportってなんだっけ
上手に飼うにはどうすれば?
上手に飼うにはどうすれば? 以下の要素は要注意! <textarea> <input> <button> <select> position(入れ子) transform (ハードウェアアクセラレータ) z-index
<input type=“text”> <textarea> <button> fixed 中身もりもりの固定要素を丸ごと動かす! これをtransformで動かしたい! 例:
fixed positionプロパティが入れ子状態で乱立! 例: absolute relative absolute
fixed 適当なz-index値の設定でおかしくなる 例: <div>
上手に飼うにはどうすれば? formへのフォーカス formからformへの移動 スクロール ズーム Javascript
上手に飼うにはどうすれば? 固定する要素はシンプルに デバイス独自の挙動を考慮する
ଞͷཁૉͷӨڹΛड͚͍͢ʂ େن։ൃͷࡍ৻ॏʹ࣮͠·͠ΐ͏ʂ
THANK YOU ! ありがとうございました。