Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Return different values based on browser width

NotificationsYou must be signed in to change notification settings

kimmelsg/cj-resized

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CircleCICoverage Status

Install

npminstallreact-resized--save

Usage

importMediafrom'react-resized'constTest=props=>(<imgsrc={props.media}/>)exportdefaultMedia(Test)(props=>[props.small,props.medium,props.large])

The correct size image will be loaded according to the browser size. Default widths are:0, 767, 1023. The size closest to the current browser width, that isn't greater than the current width, will be returned. You can optionally pass in custom sizes as the second parameter:

Media(Test)(props=>({'0':props.small,'500':props.medium,'1000':props.large}))

That's it!

About

Return different values based on browser width

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp