-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
andyliwr
committed
Nov 8, 2017
1 parent
65e332a
commit 7b8a4a2
Showing
5 changed files
with
96 additions
and
34 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,53 @@ | ||
$(document).ready(function () { | ||
var $timeline_block = $('.content section') | ||
//hide timeline blocks which are outside the viewport | ||
$timeline_block.each(function () { | ||
if ($(this).offset().top > $(window).scrollTop() + $(window).height() * 0.75) { | ||
$(this).addClass('is-hidden') | ||
} | ||
}) | ||
//on scolling, show/animate timeline blocks when enter the viewport | ||
$(window).on('scroll', function () { | ||
$timeline_block.each(function () { | ||
if ($(this).offset().top <= $(window).scrollTop() + $(window).height() * 0.75 && $(this).hasClass('is-hidden')) { | ||
$(this).removeClass('is-hidden').addClass('bounce-in') | ||
} | ||
// 时间选择控件中文化 | ||
(function($) { | ||
$.fn.datetimepicker.dates['zh-CN'] = { | ||
days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"], | ||
daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"], | ||
daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"], | ||
months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], | ||
monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], | ||
today: "今天", | ||
suffix: [], | ||
meridiem: ["上午", "下午"] | ||
}; | ||
}(jQuery)); | ||
|
||
$(document).ready(function() { | ||
var $timeline_block = $('.content section') | ||
//hide timeline blocks which are outside the viewport | ||
$timeline_block.each(function() { | ||
if ($(this).offset().top > $(window).scrollTop() + $(window).height() * 0.75) { | ||
$(this).addClass('is-hidden') | ||
} | ||
}) | ||
//on scolling, show/animate timeline blocks when enter the viewport | ||
$(window).on('scroll', function() { | ||
$timeline_block.each(function() { | ||
if ($(this).offset().top <= $(window).scrollTop() + $(window).height() * 0.75 && $(this).hasClass('is-hidden')) { | ||
$(this).removeClass('is-hidden').addClass('bounce-in') | ||
} | ||
}) | ||
}) | ||
|
||
$('.content article > h3').on('click', function() { | ||
if ($(this).hasClass('hide-more')) { | ||
$(this).removeClass('hide-more') | ||
$(this).parent().find('section').fadeIn() | ||
} else { | ||
$(this).addClass('hide-more') | ||
$(this).parent().find('section').fadeOut() | ||
} | ||
}) | ||
}) | ||
|
||
$('.content article > h3').on('click', function () { | ||
if ($(this).hasClass('hide-more')) { | ||
$(this).removeClass('hide-more') | ||
$(this).parent().find('section').fadeIn() | ||
} else { | ||
$(this).addClass('hide-more') | ||
$(this).parent().find('section').fadeOut() | ||
} | ||
}) | ||
}) | ||
// 设置时间选择控件 | ||
$('.form_date').datetimepicker({ | ||
language: 'zh', | ||
weekStart: 1, | ||
todayBtn: 1, | ||
autoclose: 1, | ||
todayHighlight: 1, | ||
startView: 2, | ||
minView: 2, | ||
forceParse: 0 | ||
}); | ||
}) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters