jquery: Flash messages

前端 未结 8 1843
再見小時候
再見小時候 2021-02-12 21:05

With jQuery, how can I display a flash message at the top of the page in an easy way? Is there something built-in, or a plugin, or is it easy enough to do it yourself?

W

8条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-12 21:50

    I ended up using jquery-notice, which is really simple and self-contained. It's MIT licensed, just a zip file with the .js and .css files, and you can call it with something like:

    
    

    Though I also liked the solution from @Brian ONeal for Notify Bar, that also looks very simple.

    jquery-notice makes a box for each message on the upper right corner of the page. Notify Bar pulls down from the top edge, and includes a few different styles for errors, regular, or success notices.

提交回复
热议问题