Position element at bottom right corner of current window

前端 未结 6 2028
悲哀的现实
悲哀的现实 2020-12-20 00:08

I\'m using the following code to send push notifications to the user...

document.triggerNotification = function (type, message) {
    jQuery(document.body).a         


        
6条回答
  •  清歌不尽
    2020-12-20 00:48

    I think jQuery can't read external stylesheets, so you have to give the div a style attribute or you change it with jQuery like this:

    document.triggerNotification = function (type, message) {
        jQuery(document.body).append("
    "+message+"
    "); jQuery('#notification').css({ right: '20px', bottom: '20px' }).show().fadeOut(1200, function () { jQuery(this).remove(); }); }

提交回复
热议问题