LoginSignup
9
8

More than 5 years have passed since last update.

JavaScriptでトーストを表示する方法

Last updated at Posted at 2018-12-27

概要

  • JavaScriptでお手軽にトーストを表示する方法を紹介します
  • 独立したライブラリなのでjQuery等への依存はありません。

toasts.gif

トーストを表示する

index.html(トーストを表示する)
<!DOCTYPE html>
<html>
<head>
    <title>JsFrame.js JavaScript Toast</title>
    <meta charset="utf-8">
</head>
<body>
<script src="https://riversun.github.io/jsframe/jsframe.js"></script>
<script>
    const jsFrame = new JSFrame();
    jsFrame.showToast({
        html: 'This is a simple toast', align: 'top', duration: 2000
    });
</script>
</body>
</html>

デモ
https://riversun.github.io/jsframe/examples/v150/toast_simple.html

ある程度カスタマイズもできます
https://riversun.github.io/jsframe/examples/jaq/toast.html

toastc.gif

まとめ

9
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
8