Python matplotlibを使って学ぶ統計処理 正規分布 新しいページはコチラ
提供: yonewiki
(→アニメーションマーカー) |
(→アニメーションマーカー) |
||
| 205行: | 205行: | ||
}); | }); | ||
$(".marker-animation2").each(function(){ | $(".marker-animation2").each(function(){ | ||
| + | var position = $(this).offset().top; //ページの一番上から要素までの距離を取得 | ||
| + | var scroll = $(window).scrollTop(); //スクロールの位置を取得 | ||
| + | var windowHeight = $(window).height(); //ウインドウの高さを取得 | ||
| + | if (scroll > position - windowHeight){ //スクロール位置が要素の位置を過ぎたとき | ||
| + | $(this).addClass('active'); //クラス「active」を与える | ||
| + | } | ||
| + | $(".marker-animation3").each(function(){ | ||
var position = $(this).offset().top; //ページの一番上から要素までの距離を取得 | var position = $(this).offset().top; //ページの一番上から要素までの距離を取得 | ||
var scroll = $(window).scrollTop(); //スクロールの位置を取得 | var scroll = $(window).scrollTop(); //スクロールの位置を取得 | ||
| 244行: | 251行: | ||
background-size: 200% 0.8em; | background-size: 200% 0.8em; | ||
background-position: 0 0.5em; | background-position: 0 0.5em; | ||
| + | transition: all 2s ease; | ||
| + | font-weight: bold; | ||
| + | } | ||
| + | |||
| + | .marker-animation3.active{ | ||
| + | background-position: -100% 0.2em; | ||
| + | } | ||
| + | |||
| + | .marker-animation3 { | ||
| + | background-image: -webkit-linear-gradient(left, transparent 50%, #7fbfff 50%); | ||
| + | background-image: -moz-linear-gradient(left, transparent 50%, #7fbfff 50%); | ||
| + | background-image: -ms-linear-gradient(left, transparent 50%, #7fbff 50%); | ||
| + | background-image: -o-linear-gradient(left, transparent 50%, #7fbfff 50%); | ||
| + | background-image: linear-gradient(left, transparent 50%, #7fbfff 50%); | ||
| + | background-repeat: repeat-x; | ||
| + | background-size: 200% 0.5em; | ||
| + | background-position: 0 0.2em; | ||
transition: all 2s ease; | transition: all 2s ease; | ||
font-weight: bold; | font-weight: bold; | ||
| 263行: | 287行: | ||
background-position: 0px 0.5em ← -100% 0.5em | background-position: 0px 0.5em ← -100% 0.5em | ||
| + | |||
| + | <span class="marker-animation2"> | ||
| + | ここにマーカーをつける文章をいれる | ||
| + | |||
| + | </span> | ||
| + | |||
| + | background-size: 200% 0.5em | ||
| + | |||
| + | background-position: 0px 0.2em ← -100% 0.2em | ||
<span class="marker-animation2"> | <span class="marker-animation2"> | ||
ここにマーカーをつける文章をいれる | ここにマーカーをつける文章をいれる | ||
</span> | </span> | ||