What is the best way to hide the screen while knockout js bindings are being built?

后端 未结 4 469
渐次进展
渐次进展 2020-12-12 13:34

I\'m a huge knockoutjs fan. I use it for all my web development now and simply love it. One thing that I\'ve not been able to figure out though is how to hide the UI while t

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-12 13:59

    Here is alternative approach using classes for "hide and "show" instead of an inline style. Add a "hide" class to the element that needs to be hidden until the contents load, and add a "css" data-binding to make it be shown when it is bound.

    The 'hide' and 'show' classes are already defined in Bootstrap.

    If Bootstrap is not being used, the CSS can be defined as:

    .hide {
      display: none !important;
    }
    .show {
      display: block !important;
    } 
    

    The order matters. The "hide" class should be defined before "show".

提交回复
热议问题