jquery: Flash messages

前端 未结 8 1685
再見小時候
再見小時候 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:30

    No plugin needed try the following out. It looks a lot like the one here on stackoverflow. You can just pass the html to the function that you want to see

        showFlash: function (message) {
        jQuery('body').prepend('');
        jQuery('#flash').html(message);
        jQuery('#flash').toggleClass('cssClassHere');
        jQuery('#flash').slideDown('slow');
        jQuery('#flash').click(function () { $('#flash').toggle('highlight') });
    },
    

提交回复
热议问题