jQuery BlockUi 消息接二连三
我正在使用 jQuery BlockUI 插件,并且我已经能够在页面中成功显示一条消息,但是...假设我想一条接一条地显示 3 条消息。
类似于:
- 消息:“你好世界!”
- 消息:“你好银河!”
- 消息:“你好宇宙!”
我如何使用 jQuery BlockUI 做到这一点?
I'm using jQuery BlockUI plugin, and i have been able to sucessfully show a single message in the page, however... let's say that I want to show 3 messages , one after another.
Something like:
- message: 'hello world!'
- message: 'hello galaxy!'
- message: 'hello universe!'
how do I do this with jQuery BlockUI?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只需在页面中创建一个 div,如下所示:
对于脚本...
这进行得非常快,但您明白了...这里的好处是您也可以将其样式设置为您想要的外观,例如:
Just create a div in your page like this:
And for the script...
This goes by very fast, but you get the idea....bonus here is you can style it to look however you want as well, e.g.:
当您在 onBlock 或 onUnBlock 上调用某些回调函数时,这不起作用,例如:
$.blockUI({
message : '您的新消息',
onBlock : 回调函数
});
另一种方法是,只需使用不同的消息再次调用 blockUI:
$.blockUI({ message: 'New message' });
This does not work when you have some callback function is being called on onBlock or onUnBlock, for example like this:
$.blockUI({
message : 'your new message',
onBlock : callbackFunction
});
An alternative to this would be, just call blockUI again with a different message:
$.blockUI({ message: 'New message' });