An open API service indexing awesome lists of open source software.

https://github.com/appleple/js-rotation-banner


https://github.com/appleple/js-rotation-banner

Last synced: over 1 year ago
JSON representation

Awesome Lists containing this project

README

          

# js-rotation-banner

[![GitHub license](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://raw.githubusercontent.com/appleple/document-outliner/master/LICENSE)

複数のバナー画像を指定した規則通りに並び替えてくれるjsライブラリ

## Usage
distの中にあるrotation-banner.bundle.js,rotationbanner.cssを使用したいフォルダに設置して、使用するHTMLファイルのhead要素内にJavaScriptファイルとCSSファイルの読み込みを記述してください。
```html

```
```html

```
cfg-csv.js
```js
document.addEventListener("DOMContentLoaded", () => {
new RotationBanner({
url: "sampleUrl",
rel: "sponsored",
aTagclass: "banner",
loading: "lazy",
});
});
```

### Basic Standalone Usage
一セット三枚のバナーを計九枚表示させるとき
```html

サンプルです



サンプルです



サンプルです



```

### Attribute
data-quantity → 表示させる枚数
data-offset → 指定した日付によってバナーを並び替える
data-id → 並び替える数字を指定

### Option


variable
description
default


url
用意した画像データをAPIで持ってくる為に必要なurl
初期値無し


rel
スポンサーさんからの情報にはつけなきゃいけない決まり事
初期値無し


aTagclass
aタグのクラス
banner


loading
遅延読み込み
lazy