Position element at bottom right corner of current window

前端 未结 6 2022
悲哀的现实
悲哀的现实 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:39

    Yeah, you need to look at using position: fixed for browsers that support it then, as IE6 is the only used browser nowadays that doesn't just add

    * html .push-notification {
       position: absolute;
    }
    

    AFTER the original style rules for the notifications.

    If you wanted a javascript solution you could get the document scrollTop/bottom and work out how far from the bottom of the screen to show it. But with this you would need an onscroll event to move it if the user scrolled

提交回复
热议问题