jQuery toast option 自定义

Jquery Toast Plugin​​​​​​​

$.toast({ 

  text : "Let's test some HTML stuff... <a href='#'>github</a>", 

  showHideTransition : 'slide',  // It can be plain, fade or slide

  bgColor : 'blue',              // Background color for toast

  textColor : '#eee',            // text color

  allowToastClose : false,       // Show the close button or not

  hideAfter : 5000,              // `false` to make it sticky or time in miliseconds to hide after

  stack : 5,                     // `fakse` to show one stack at a time count showing the number of toasts that can be shown at once

  textAlign : 'left',            // Alignment of text i.e. left, right, center

  position : 'bottom-left'       // bottom-left or bottom-right or bottom-center or top-left or top-right or top-center or mid-center or an object representing the left, right, top, bottom values to position the toast on page

})

自己封装下:

function toast_with_position(title, msg, position){
    var text = "<span style='font-size: large;'>" + _t_(msg) + "</span>";
    var heading = "<span style='font-size: x-large;'>" + _t_(title) + "</span>";
    $.toast({
        heading: heading,
        text: text,
        textAlign: 'center',
        showHideTransition: 'slide',
        icon: 'info',
        loader: false,
        position: _t_(position)
    });
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值