移动端开发 求大神!!!!
銀角大王 2017-11-06 03:54:49 $(document).ready(function(e) {
var type = $(".type").text();
var t1 = parseInt($(".body").width());
var t2 = t1*10.08/6.4; // 这里为什么要乘以10.08 再除以6.4呢 ???
if(type=="ipad"){
t2 = t1*8/6.4;
}else{
t2 = t1*10.08/6.4;
}
var w_height = parseInt($(".body").width())*parseInt($(window).height())/parseInt($(window).width());
var top = 0;
var height = w_height;
if(w_height-t2>0){
top = (w_height-t2)/2;
height = w_height;
}else{
top = 0;
height = t2;
}
$("#first").css("height",height);
$("#second").css("height",height);
$("#third").css("height",height);
$("#fourth").css("height",height);
$(".load").css("height",w_height);
$(".load img").css("top",top);
$(".loads").css("height",w_height);
$(".loads img").css("top",top);
});[b][b][/b][/b]