Python matplotlibを使って学ぶ統計処理 正規分布 新しいページはコチラ
提供: yonewiki
(→アニメーションマーカー) |
(→アニメーションマーカー) |
||
| 147行: | 147行: | ||
=== アニメーションマーカー === | === アニメーションマーカー === | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
| 271行: | 233行: | ||
<style type= "text/css"> | <style type= "text/css"> | ||
.marker-animation.active{ | .marker-animation.active{ | ||
| − | background-position: - | + | background-position: -100% 100%; |
} | } | ||
| 366行: | 328行: | ||
ここにマーカーをつける文章をいれる | ここにマーカーをつける文章をいれる | ||
</span> | </span> | ||
| + | |||
マーカーを縦にグラデーションする方式のスクリプト | マーカーを縦にグラデーションする方式のスクリプト | ||
| 404行: | 367行: | ||
</style> | </style> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| + | |||
lineargradient(to bottom,… -webkit-llineargradient(bottom その他のブラウザ向けもwebkitと同じ | lineargradient(to bottom,… -webkit-llineargradient(bottom その他のブラウザ向けもwebkitと同じ | ||
| 414行: | 378行: | ||
<span class="marker-animation4"> | <span class="marker-animation4"> | ||
| + | ここにマーカーをつける文章をいれる | ||
| + | </span> | ||
| + | |||
| + | |||
| + | <yjavascript> | ||
| + | <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> | ||
| + | <script> | ||
| + | $(window).scroll(function (){ | ||
| + | $(".marker-animation5").each(function(){ | ||
| + | var position = $(this).offset().top; //ページの一番上から要素までの距離を取得 | ||
| + | var scroll = $(window).scrollTop(); //スクロールの位置を取得 | ||
| + | var windowHeight = $(window).height(); //ウインドウの高さを取得 | ||
| + | if (scroll > position - windowHeight){ //スクロール位置が要素の位置を過ぎたとき | ||
| + | $(this).addClass('active'); //クラス「active」を与える | ||
| + | } | ||
| + | }); | ||
| + | }); | ||
| + | </script> | ||
| + | <style type= "text/css"> | ||
| + | .marker-animation5.active{ | ||
| + | background-size: 100% 100%; | ||
| + | background-position: 0px 100%; | ||
| + | } | ||
| + | |||
| + | .marker-animation5 { | ||
| + | background-image: -webkit-linear-gradient(bottom, transparent 50%, #7fbfff 50%); | ||
| + | background-image: -moz-linear-gradient(bottom, transparent 50%, #7fbfff 50%); | ||
| + | background-image: -ms-linear-gradient(bottom, transparent 50%, #7fbff 50%); | ||
| + | background-image: -o-linear-gradient(bottom, transparent 50%, #7fbfff 50%); | ||
| + | background-image: linear-gradient(to bottom, transparent 50%, #7fbfff 50%); | ||
| + | background-repeat: no-repeat; | ||
| + | background-size: 0% 100%; | ||
| + | background-position: 0px 100%; | ||
| + | transition: all 5s ease; | ||
| + | font-weight: bold; | ||
| + | } | ||
| + | </style> | ||
| + | </yjavascript> | ||
| + | |||
| + | <span class="marker-animation5"> | ||
ここにマーカーをつける文章をいれる | ここにマーカーをつける文章をいれる | ||
</span> | </span> | ||