我正在显示带有消息的NOTY。我想更新显示的消息,因此noty会显示实时更新。
我已经尝试了这个并且noty有一个显示'TEST'的文本输入字段,但它永远不会更新说HELLO。
var n = noty({ type: 'information', layout: 'center', text: "<input id='msg' name='msg' value='TEST' />",
dismissQueue: true, theme: 'relax', modal: true, maxVisible: 1 })
$('#msg').val('HELLO')
可以这样做吗? 感谢
答案 0 :(得分:1)
new Noty({
...
text: 'Some notification text',
...
}).show();
摘录:
new Noty({
type: 'information',
layout: 'center',
text: "<input id='msg' name='msg' value='TEST' />",
dismissQueue: true,
theme: 'relax',
modal: true,
maxVisible: 1
}).show();
$('#msg').val('HELLO')
&#13;
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://rawgit.com/needim/noty/master/lib/noty.css">
<script src="https://rawgit.com/needim/noty/master/lib/noty.min.js"></script>
&#13;