Bootstrap3 Toast消息框插件

Bootoast是一款Bootstrap3 Toast消息框插件。通过Bootoast插件你可以非常方便的制作Toast消息框效果,并且插件提供了各种参数来控制Toast消息框。

使用方法

在页面中引入bootstrap.min.css文件,bootoast.css,以及jquery和bootoast.js文件。

<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/bootoast.css">
<script src="jquery.min.js"></script>
<script src="bootoast.js"></script>
                
API

Bootoast插件的默认配置如下:

bootoast({
    message: 'Helo!',
    type: 'info',
    position: 'bottom-center',
    icon: undefined,
    timeout: false,
    animationDuration: 300,
    dismissable: true
});
                

配置参数

参数 默认值 描述
message 'Helo!' Toast消息,可以是任何html字符串。
type 'info' bootstrap情景类的class名称。
icon 根据选择的情景类来决定。 Bootstrap 3 glyphicons名称。
position 'bottom-center' Toast消息显示的位置。可以是top,left-top,right-top,bottom,left-bottom,right-bottom。
timeout false Toast自动隐藏的时间。设置为false或0表示不会自动隐藏。
dismissable true 是否在Toast上显示×按钮。
animationDuration 300 Toast隐藏动画的持续时间,单位毫秒。

Bootoast-Bootstrap3 Toast消息框插件的github地址为:https://github.com/odahcam/bootoast

在线预览    源码下载

爱编程-编程爱好者经验分享平台
版权所有 爱编程 © Copyright 2012. All Rights Reserved.
闽ICP备12017094号-3