...
|
...
|
@@ -13,7 +13,8 @@ class Photography extends Page { |
|
|
$gender: $('.s-title.baby-gender'),
|
|
|
$birthday: $('.s-title.baby-birthday'),
|
|
|
$noDate: $('.s-title.modify[type!=date]'),
|
|
|
$growthC: $('.growth-c')
|
|
|
$growthC: $('.growth-c'),
|
|
|
$growth: $('.growth')
|
|
|
};
|
|
|
|
|
|
this.init();
|
...
|
...
|
@@ -28,9 +29,26 @@ class Photography extends Page { |
|
|
}
|
|
|
|
|
|
growthRePosition() {
|
|
|
let gWidth = this.selector.$growthC.width() / 2;
|
|
|
let gWidth = this.selector.$growth.width() / 2;
|
|
|
let growthW = this.selector.$growth.width();
|
|
|
|
|
|
this.selector.$growthC.css('width', `${growthW}px`);
|
|
|
this.selector.$growthC.css('margin-left', `-${gWidth}px`);
|
|
|
setTimeout(() => {
|
|
|
let limit = $(window).width() / 750 * 30;
|
|
|
let offset = this.selector.$growthC.offset().left;
|
|
|
let limitRight = $(window).width() - offset - limit - growthW;
|
|
|
let limitLeft = offset - limit;
|
|
|
|
|
|
if (limitRight <= 0) {
|
|
|
// 右边超出
|
|
|
this.selector.$growth.css('margin-left', `${limitRight}px`);
|
|
|
}
|
|
|
if (limitLeft <= 0) {
|
|
|
// 左边超出
|
|
|
this.selector.$growth.css('margin-left', `${-limitLeft}px`);
|
|
|
}
|
|
|
}, 100);
|
|
|
}
|
|
|
|
|
|
bindEvents() {
|
...
|
...
|
|