1. Trang chủ
  2. » Công Nghệ Thông Tin

jQuery & Responsive Web Design: Short guide by Dave Rupert

51 255 1
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề jQuery & Responsive Web Design
Trường học Paravel
Chuyên ngành Web Design
Thể loại presentation
Định dạng
Số trang 51
Dung lượng 8,61 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Responsive web design (RWD) is a web design approach aimed at crafting sites to provide an optimal viewing experience—easy reading and navigation with a minimum of resizing, panning, and scrolling—across a wide range of devices (from mobile phones to desktop computer monitors). A site designed with RWD adapts the layout to the viewing environment by using fluid, proportion-based grids, flexible images, and CSS3 media querie Tips to winning at responsive design - Embrace the flexible grid. - Preserve content hierarchy - Break up with pixel-perfection. - Don’t use pixels. - Use EM units for font-size. - Learn by doing.

Trang 1

& Responsive Web Design

w/ Dave Rupert @davatron5000

#jqsummit #rwd

Trang 2

I work at Paravel.

http://paravelinc.com && @paravelinc

Trang 3

I host the ATX Web Show.

http://atxwebshow.com && @atxwebshow

Trang 4

I make tiny jQuery

plugins.

< 100 lines of code each!

Trang 5

> Stop talking about yourself.

Ok! Let’s get down

to business!

Trang 6

• Fluid Resizing of V

ideo Embeds

• Fluid Image Rotat

Trang 7

$18

Trang 9

RWD Basics

FLEXIBLE GRID FLEXIBLE MEDIA

This is the f

un,next lvl #$

%&

Trang 10

2%

Trang 11

WARNING!

THE NEXT SLIDE CONTAINS: MATH

IF YOU FEEL NAUSEOUS, CLOSE EYES

UNTIL THE FEELING SUBSIDES.

Trang 12

target ÷ context = result

Trang 13

i.e Fluid 960 Grid container_12 grid_4 { width: 300px; }

300px / 960px = 0.3125

x 100 31.25%

target ÷ context

Trang 14

On the Griddle

http://csswizardry.com/fluid-grids/

http://grids.heroku.com/

http://goldengridsystem.com/ by @jonikorpihttps://github.com/davatron5000/foldy960http://cssgrid.net/ “The 1140 Grid”

http://css-tricks.com/responsive-framework.css

Trang 15

Flexible Media

img, video { max-width: 100%; }

Trang 17

@media queries

Where you’ll use

- Change the layout as needed.

i.e Make content absorb more/less of the grid.

- Change the style of elements.

i.e Make <LI> elements resemble a “mobile” app.

- Change base font-size.

Trang 18

Responsive Web Design

Tips to winning at

- Embrace the flexible grid.

- Preserve content hierarchy

- Break up with pixel-perfection.

- Don’t use pixels

- Use EM units for font-size.

- Learn by doing.

Trang 19

> This is all CSS What’s this

have to do with jQuery?

Good question!

Trang 20

CSS gets us 100% of

the way there, but

> Does not compute.

Trang 21

Iron out the wrinkles

with just a few sprinkles of JavaScript

> “SPRINKLES”!??! JavaScript is a serious language for serious people!

Trang 22

Part Deux

Using tiny jQueries to solve common problems in RWD

Trang 23

I wish there was a way for headlines to fill up their parent container, then scale like an image.

The Paravel Workflow™

Hrmmmm

Trang 24

1 Hour Later

I think I’ve got something! Check the dropbox.

Trang 26

How FitText Works

Trang 27

Behind the Scenes

Trang 29

I’d pay well for a video service that made

embedding fluid/responsive videos the right way easy It’s way more difficult than you’d think.

The Next Day

+1

Hrmmmm

Trang 30

Don’t worry, bros! I got this

1 Hour Later

Let me know if you need help, I’ve got some ideas.

Perfect! I was going to google your blog anyways to figure it out You supply the brains and I’ll make a tiny jQuery plugin!

Trang 32

The Problem

Trang 33

You can try

iframe {width: 100%;}

Trang 34

You can try

iframe { width: 100%; height: auto; }

Trang 35

With FitVids

Trang 36

How FitVids Works

Trang 38

Intrinsic Ratio Method

$allVideos.each(function(){

var aspectRatio = $(this).height() / $(this).width();

   $(this).wrap('<div class="fluid-width-video-wrapper" />')

.parent('.fluid-width-video-wrapper') .css('padding-top', (aspectRatio * 100)+"%");

   $(this).removeAttr('height').removeAttr('width');

});

* code is only slightly simplified srsly.

http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/

Trang 39

> Cool story, bro.

Just one more!

Trang 42

Easy! I’ll just use my trusty jquery.cycle plugin!

I’ve used this infinity-billion times.

Trang 43

Crap Doesn’t work.

> Now you’ll have to actually

program something.

Trang 45

2 Great Choices

5.1 kb

1.9 kb minified

6 options

Credit: Mark Tyrrell @marktyrrelluk

Last commit: August 14th, 2011

Trang 46

How they Work

<link rel="stylesheet" href="flexslider.css" type="text/css">

Trang 48

BOOM Get money.

Trang 49

> Wrap it up.

Just about to.

Trang 50

FACT:

The internet needs

your help

Please contribute to open source projects and help

solve small problems with JavaScript.

Trang 51

Questions, comments, concerns?

© Dave Rupert http://daverupert.com @davatron5000

Ngày đăng: 19/06/2014, 11:03

TỪ KHÓA LIÊN QUAN