Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新手一枚,手势换屏,怎么解决PSD切出来的图的适配问题呢? #24

Open
impguier opened this issue Feb 16, 2015 · 1 comment

Comments

@impguier
Copy link

新手一枚,手势换屏,怎么解决PSD切出来的图的适配问题呢?
要用JS去计算每一个图片元素的位置和宽高么

@Loyalsoldier
Copy link

用 Javascript 检测当前浏览器的页面宽高,然后根据 PSD 制作时的机型分辨率,相应地用 transform: scale (缩放)相应尺寸。可以是背景的缩放,也可以是整个页面的缩放。
另外,如果背景图是没有文字内容,并且不太重要,建议直接使用 background-size: cover 和 overflow: hidden 来填满整个浏览器宽高。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants