如何为notify.js警报消息应用样式

时间:2017-12-11 09:08:29

标签: javascript notifyjs

我需要知道如何为notify.js警报应用$.notify({ message: "Alert!" }, { type: 'danger', animate: { enter: 'animated fadeInUp', }, placement: { from: "top", align: "center" }, offset: 20, spacing: 10, z_index: 1031, }); 个样式。

这是我的代码 -

<form name="form1" action="test1.php" method="post">
<table class="questiontable" border="0">
<tr><td><input type="submit" onclick="send()" name="previous_question" id="previous_question" value="Previous Question"></td></tr>
</table>
</form>
<script>
function send(){
    this.disabled=true; 
    this.value='Please Wait...'; 
    this.form.submit();
}
</script>
<?php
echo $_POST["previous_question"] ;
?>

我需要为此应用一些样式。

1 个答案:

答案 0 :(得分:0)

$.notify({
  message: "Alert!"
}, {
  type: 'danger',
  animate: {
    enter: 'animated fadeInUp',
  },
  placement: {
    from: "top",
    align: "center"
  },
  offset: 20,
  spacing: 10,
  z_index: 1031,
  style: 'addClassName'
});

然后这样的结构将在html中为notifiy

构建
<div class="notifyjs-addClassName-base notifyjs-addClassNamesuccess">
    <div class="clearfix">
      <div class="title" data-notify-html="title">Would you like some Foo ?
      </div>
      <div class="buttons">
         <button class="no">Cancel</button>
         <button class="yes" data-notify-text="button">Confirm</button>
      </div>
    </div>
  </div>

然后你可以根据需要创建1个css filr并添加css,使这个.notifyjs-addClassName-base成为基类

.notifyjs-addClassName-base{

}