On hide don't remove from DOM

2 posts, 1 answers
  1. Bilal
    Bilal avatar
    109 posts
    Member since:
    Oct 2014

    Posted 20 Feb 2015 Link to this post

    I noticed when hiding a notification, the notification gets removed from DOM hence, the entire UI I have shifts up to replace the gap that was filled by notification.

    Is there a way to just hide the notification without removing it from DOM?

    Best regards
    Bilal Haidar
  2. Answer
    Dimo avatar
    8486 posts

    Posted 24 Feb 2015 Link to this post

    Hi Bilal,

    The fact that your UI shifts suggests that the some static notifications are displayed inside a container with no height. I recommend using a fixed height container for the notification messages, just like in this demo:


    Alternatively, you can use min and/or max height styles for the container.

    On the other hand, popup notification messages have no influence on the remaining page content, so you can choose this approach too.

    There is no built-in way to only hide notification messages without removing them from the DOM. A possible approach is to configure the notifications to be always visible and hide them manually with custom Javascript and a visibility:hidden style.


    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top