wentin/ResponsifyJS
소개
누구의 얼굴도 잘리지 않게 이미지를 진정한 반응형으로 만들어 주는 jQuery 플러그인입니다. 별을 더 많이 눌러 주세요!
디자인 및 미디어측정된 스타 증가
- in 24h
- 0
- in 7 days
- -1
- in 15 days
- -1
- in 1 month
- -1
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalResponsify.js
A jquery plugin that makes images truly responsive, without sacrificing anyone's face :D
When images are used in a responsive container on web design, because of the container can change to any width:height ratio, a group shot could end up being cut off on people's faces, a nice photograph following "rule of third" could end up with no object in view. Responsive images face the challenge of how to keep the focused objects/area in view, this jquery plugin is here to solve the problem.
Download
Demo
https://responsifyjs.wentin.net/
App
https://responsifyjs.wentin.net/app
Use this interactive web app to generate the focus area data
What it does
Responsify.js does the following:
- It allows you define a focus area on an image using
data-focus-xxxtag - It takes in the focus area data from the image, calcuate the image's container's size, resize and position the image accordingly, make sure the focus area is always in view and in the best position possible.
- Responsive image with responsify.js
- Responsive image without responsify.js
How to use
- Use this interactive web app to generate the focus area data http://responsifyjs.space/app/
<img src="image.png" alt=""
data-focus-left=".30" data-focus-top=".12" data-focus-right=".79" data-focus-bottom=".66" />
data-focus-left is the focus area's left position comparing to the image's full width, in decimal. For example, if the full width is 300px, the focus area's left is 90, then the data-focus-left should be 90/300 = 0.3. Same logic applies to other three data attributes.
- Embed the responsify.js in the html
<script src="responsify.js"></script>
- Call responsify function when window object is loaded
$(window).load(function() {
$('img').responsify();
});
- Call responsify function again when the window is being resized (optional)
$(window).resize(function(){
$('img').responsify();
})
###Contact Me
- Follow @DesignJokes on Twitter
- Email [email protected]
###Other Project by Wentin
관련 프로젝트 살펴보기
불러오는 중…