4da3dce2 by TaishiTokudome Committed by Yokihito Oki

cherry pick 34395a2c

1 parent 80e64bfa
......@@ -203,45 +203,51 @@ if ($this->params->get('logoFile')) {
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
<script>
jQuery(function($) {
var obj = $("#aside");
var offset = $(obj).offset();
var topPadding = 135;
var sW = window.innerWidth;
var sH = window.innerHeight;
var cW = obj.width();
var cH = obj.height();
var cwrapH = $("#c_wrap").height();
// 特定のページではスクロールしない
var excludedPages = [".record-page"];
var excludedPagesSelector = excludedPages.join(', ');
var isExcluded = false;
if (document.querySelector(excludedPagesSelector)) {
isExcluded = true;
}
if (cH) {
if (sH > cH) {
if (isExcluded) return false;
$(window).scroll(function() {
if ($(window).scrollTop() > offset.top) {
if ($(window).scrollTop() < cwrapH) {
window.onload = function() {
jQuery(function($) {
var obj = $("#aside");
var sW = window.innerWidth;
var sH = window.innerHeight;
var cW = obj.width();
var cH = obj.height();
var cwrapH = $("#c_wrap").height();
// 特定のページではスクロールしない
var excludedPages = [".record-page"];
var excludedPagesSelector = excludedPages.join(', ');
var isExcluded = false;
if (document.querySelector(excludedPagesSelector)) {
isExcluded = true;
}
var customHeight = $(".custom").height();
var paddingTop = customHeight - 80;
if (cH) {
if (sH > cH) {
if (isExcluded) return false;
$(window).resize(function() {
customHeight = $(".custom").height();
paddingTop = customHeight - 80;
});
$(window).scroll(function() {
if ($(window).scrollTop() > customHeight) {
if ($(window).scrollTop() < cwrapH) {
$(obj).stop().animate({
duration: 'fast',
marginTop: $(window).scrollTop() - paddingTop
});
} else {
$(obj).stop().animate({});
}
} else {
$(obj).stop().animate({
duration: 'fast',
marginTop: $(window).scrollTop() - offset.top + topPadding
marginTop: 0
});
} else {
$(obj).stop().animate({});
}
} else {
$(obj).stop().animate({
marginTop: 0
});
}
});
});
}
}
}
});
});
};
</script>
</head>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!