forked from 0x2620/pandora
only run adjustRatio after image is loaded
This commit is contained in:
parent
2727c3d27d
commit
6c1aa50ed2
1 changed files with 15 additions and 14 deletions
|
@ -261,20 +261,21 @@ pandora.ui.home = function() {
|
||||||
var height = $logo.height();
|
var height = $logo.height();
|
||||||
if (width == 0 || height == 0) {
|
if (width == 0 || height == 0) {
|
||||||
setTimeout(adjustRatio, 50);
|
setTimeout(adjustRatio, 50);
|
||||||
}
|
} else {
|
||||||
var aspect = width / height;
|
var aspect = width / height;
|
||||||
if (aspect != 2) {
|
if (aspect != 2) {
|
||||||
var top = 320 / aspect;
|
var top = 320 / aspect;
|
||||||
$reflectionImage.css({
|
$reflectionImage.css({
|
||||||
top: top + 'px',
|
top: top + 'px',
|
||||||
})
|
})
|
||||||
$reflectionGradient.css({
|
$reflectionGradient.css({
|
||||||
top: top + 'px',
|
top: top + 'px',
|
||||||
height: (top + 2) + 'px',
|
height: (top + 2) + 'px',
|
||||||
})
|
})
|
||||||
$logo.css({
|
$logo.css({
|
||||||
bottom: top + 'px',
|
bottom: top + 'px',
|
||||||
})
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue