开发者

Jgrowl like notification using dojo

Is there anything in开发者_如何学编程 Dojo like the jquery jgrowl.


There exists dojox.widget.Toaster. (Test-File & API Documentation)

You need to create a new channel with the Toaster, for example.

var errors = new dojox.widget.Toaster({
    messageTopic: '/app/error',
    positionDirection: 'br-up',
    duration: 5000
});

After this you can publish with dojo.publish to the channel /app/error

dojo.publish('/app/error', ["Error sending data"]);

Don't forget to load the Toaster CSS dojox/widget/Toaster/Toaster.css

If you want it black, you need to change the CSS. I created an example with two Toasters, one displays new messages in the right upper corner, the other in the right bottom corner. And i made them black.

JS Fiddle


Check out this github project.

I was looking for the same thing, but with a bit more features than the Toaster widget provided. So I started the dGrowl project.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜