登录详细信息为:
代码:AAAAAA 名称:测试
当您在iPad或iPad mini上访问该网站时,一旦您登录,您将被引导至欢迎页面。在那个页面上,一些气球将从顶部到达,它们将进入树中。问题是:
该动画的js是:
for (i = 1; i <= 7; i++) {
$('.trans' + i).toggleClass('toggle1');
};
setTimeout(function () {
$('.posRel').fadeTo('slow', 2, function () {
$('.toggle1').toggleClass('fSmall1');
});
}, 2000);
这些气球的Css是:
.trans1 { position:absolute; top:-50px; left:0%; width:23px; height:63px; background-color:#00F; -moz-transition:all 2s ease; -webkit-transition:all 2s ease; transition:all 2s ease; background:url(../images/fruit-small.png) left top no-repeat; z-index:10; }
.trans2 { position:absolute; top:-200px; left:25%; width:23px; height:63px; background-color:#00F; -moz-transition:all 2s ease; -webkit-transition:all 2s ease; transition:all 2s ease; background:url(../images/fruit-small.png) left top no-repeat; z-index:10; }
.trans3 { position:absolute; top:-300px; left:35%; width:23px; height:63px; background-color:#00F; -moz-transition:all 2s ease; -webkit-transition:all 2s ease; transition:all 2s ease; background:url(../images/fruit-small.png) left top no-repeat; z-index:10; }
.trans4 { position:absolute; top:-160px; left:45%; width:23px; height:63px; background-color:#00F; -moz-transition:all 2s ease; -webkit-transition:all 2s ease; transition:all 2s ease; background:url(../images/fruit-small.png) left top no-repeat; z-index:10; }
.trans5 { position:absolute; top:-160px; right:5%; width:23px; height:63px; background-color:#00F; -moz-transition:all 2s ease; -webkit-transition:all 2s ease; transition:all 2s ease; background:url(../images/fruit-small.png) left top no-repeat; z-index:10; }
.trans6 { position:absolute; top:-160px; left:245%; width:23px; height:63px; background-color:#00F; -moz-transition:all 2s ease; -webkit-transition:all 2s ease; transition:all 2s ease; background:url(../images/fruit-small.png) left top no-repeat; z-index:10; }
.trans7 { position:absolute; top:-160px; right:0%; width:23px; height:63px; background-color:#00F; -moz-transition:all 2s ease; -webkit-transition:all 2s ease; transition:all 2s ease; background:url(../images/fruit-small.png) left top no-repeat; z-index:10; }
.trans1.toggle { left:578px; margin-left:-50px; top:400px; }
.trans2.toggle { left:528px; margin-left:-50px; top:400px; }
.trans3.toggle { left:418px; margin-left:-50px; top:460px; }
.trans4.toggle { left:518px; margin-left:-50px; top:330px; }
.trans5.toggle { left:450px; margin-left:-50px; top:350px; }
.trans6.toggle { left:588px; margin-left:-50px; top:340px; }
.trans7.toggle { left:468px; margin-left:-50px; top:350px; }
然后,我已应用switch case来获取窗口方向的更改:
switch ( window.orientation ) {
case 0:
//alert('portrait mode');
var wHeight = $(window).height();
var newHeight = wHeight-110;
//alert(newHeight);
$(".sitewid.pad25.p2height").css('min-height',newHeight);
$("#footer").toggleClass(".footer1");
$(".footer1").css("bottom","00px !important");
$(window).bind("load", function() {for (i = 1; i <= 7; i++) {$('.trans' + i).toggleClass('toggle1');}; setTimeout(function () { $('.posRel').fadeTo('slow', 2, function () {$('.toggle1').toggleClass('fSmall1');}); }, 2000);
});
break;
case 90:
//alert('landscape mode screen turned to the left');
var wHeight = $(window).height();
var newHeight = wHeight-110;
//alert(newHeight);
$(".sitewid.pad25.p2height").css('min-height',newHeight);
$("#footer").toggleClass(".footer1");
$(".footer1").css("bottom","00px !important")
$(window).bind("load", function() {for (i = 1; i <= 7; i++) {$('.trans' + i).toggleClass('toggle');};setTimeout(function () { $('.posRel').fadeTo('slow', 2, function () {$('.toggle').toggleClass('fSmall1');}); }, 2000);
});
break;
case -90:
//alert('landscape mode screen turned to the right');
var wHeight = $(window).height();
var newHeight = wHeight-110;
//alert(newHeight);
$(".sitewid.pad25.p2height").css('min-height',newHeight);
$("#footer").toggleClass(".footer1");
$(".footer1").css("bottom","00px !important")
$(window).bind("load", function() {for (i = 1; i <= 7; i++) {$('.trans' + i).toggleClass('toggle');};setTimeout(function () { $('.posRel').fadeTo('slow', 2, function () {$('.toggle').toggleClass('fSmall1');}); }, 2000);
});
break;
}
}, false);
你能否告诉我我做错了什么或我需要做什么,以便当窗户方向改变时,气球放置正确。树和草和其他所有元素都正确放置,但当方向发生变化时,气球没有到达原来的位置。感谢您对此进行调查。