0.0.2 • Published 7 years ago
jquery.initscroll v0.0.2
jQuery.initScroll
ハッシュ付きURLにアクセスした時、対象の要素までスクロールさせるjQueryプラグイン
Installation
npm install --save jquery.initscroll
Usage
<script src="jquery.min.js"></script>
<script src="jquery.initscroll.min.js"></script>
<script>
$(function() {
$('html,body').initScroll(options);
});
</script>
Options
offset
Type: number
Default: 0
本来のスクロール位置から移動させるoffsetObject
Type: jQuery Object
Default: null
指定したオブジェクトの位置と高さ分、本来のスクロール位置から移動させるduration
Type: number
Default: 600
スクロール時間(ミリ秒)easing
Type: string
Default: 'swing'
イージングの種類
※jQuery単体では「linear」と「swing」の2種類だけなので、それ以外を指定する場合は別途「jQuery Easing Plugin」等が必要
jQuery Support
- 3.0.0+
- 2.0.0+
- 1.8.0+
Browser Support
- Google Chrome
- Safari
- Firefox
- Edge
- IE 9+
License
MIT