-
Notifications
You must be signed in to change notification settings - Fork 89
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
page子元素的尺寸问题 #9
Comments
这个组件主要针对一些运营类活动,比如微信朋友圈的广告落地页,一些产品宣传页等,他们都有个特点就是一屏一屏的滑动,这类页面的适配其实不适合 // 放大元素,按照320x504定位,按比例scale
function scaleEle(selector,position){
var pageScale;
var currentScale=screenWidth/screenHeight;
var originScale=320/504;
if(currentScale>originScale){
pageScale=screenHeight/504;
}else{
pageScale=screenWidth/320;
}
$(selector).css({"-webkit-transform-origin":position,"transform-origin":position,"-webkit-transform":"scale("+pageScale+");","transform":"scale("+pageScale+");"});
}
var screenHeight = document.documentElement.clientHeight,
screenWidth = document.documentElement.clientWidth;
scaleEle(".mod-page-list__page","center"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
请教下大神,page里面的子元素尺寸怎么设置呢,比如设计稿750*1334
我子元素写px 还是用scss计算写rem来布局,还是直接img作为子元素用百分比,
我现在是 js计算设定html的dpi,用rem来布局,但是无论我用什么方案 在ip4 ip5等不一样机型都会和设计稿有差异,哎 好头疼,大神有什么好的方案么
联系邮箱 [email protected]
The text was updated successfully, but these errors were encountered: