Framework7-list-views-swipe-jsapis
提供:Dev Guides
Framework7-スワイプアウトJavaScript API
説明
スワイプアウトは、要素を制御するJavaScript APIを提供します。 適切なアプリのプロパティとメソッドは以下のとおりです-
S.No | Methods | Description & Parameters |
---|---|---|
1 | myApp.swipeoutOpen(el, direction, callback) |
It is used to reveal swipeout actions on element which is specified.
|
2 | myApp.swipeoutClose(el, callback) |
It is used to close swipeout actions on element which is specified.
|
3 | myApp.swipeoutDelete(el, callback) |
It is used to delete specified element of swipeout.
|
4 | myApp.swipeoutOpenedEl | This property contains link to swipeout HTMLElement that is opened currently. |
例
次の例では、Framework7でJavaScript APIを使用して要素をスワイプできます-
出力
上記のコードがどのように機能するかを確認するために次の手順を実行してみましょう-
- 上記のHTMLコードを list_views_swipe_jsapisl ファイルとしてサーバーのルートフォルダーに保存します。
- このHTMLファイルをhttp://localhost/list_views_swipe_jsapislとして開きます。出力は以下のように表示されます。
- この例では、リンクをクリックして要素を削除し、要素を開くことができます。