|
|
@@ -824,10 +824,14 @@
|
|
|
// 点击前一页
|
|
|
$('.date_line .pre_month').click(function(){
|
|
|
let offsetNum = $('.date_tab_list').position().left
|
|
|
- // console.log('父元素偏移量', offsetNum)
|
|
|
- if (Math.abs(offsetNum) >= 1170) {
|
|
|
+ // console.log('父元素偏移量', Math.abs(offsetNum))
|
|
|
+ if (Math.abs(offsetNum) > 0) {
|
|
|
+ $('.date_line .pre_month').css('display', 'none')
|
|
|
let offsetLeft = (offsetNum + 1170 + 'px')
|
|
|
$(".date_tab_list").animate({left: offsetLeft}, 1000)
|
|
|
+ setTimeout(function(){
|
|
|
+ $('.date_line .pre_month').css('display', 'block')
|
|
|
+ },1000)
|
|
|
} else {
|
|
|
console.log('已到头')
|
|
|
}
|
|
|
@@ -842,8 +846,12 @@
|
|
|
// console.log('子元素数量', childrenNum)
|
|
|
// console.log('最大偏移量', maxOffset)
|
|
|
if (Math.abs(offsetNum) < maxOffset) {
|
|
|
+ $('.date_line .next_month').css('display', 'none')
|
|
|
let offsetLeft = (offsetNum - 1170 + 'px')
|
|
|
$(".date_tab_list").animate({left: offsetLeft}, 1000)
|
|
|
+ setTimeout(function(){
|
|
|
+ $('.date_line .next_month').css('display', 'block')
|
|
|
+ },1000)
|
|
|
} else {
|
|
|
console.log('已到达最大距离')
|
|
|
}
|