search

Home  >  Q&A  >  body text

angular.js - The page needs to be filled with js to fill the width. When the ui-router is switched, the page will flicker. How to solve it?

The page needs to be filled with js to fill the width. When ui-router switches, you will see the page flickering. It should be js running. Is there a way to make js execute first and then display the page to eliminate the flickering

阿神阿神2782 days ago809

reply all(3)I'll reply

  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-05-16 13:21:47

    You can set a mask layer with 100% height and width first, and then set the mask to display:none after the real page is switched.

    reply
    0
  • 迷茫

    迷茫2017-05-16 13:21:47

    Simply, you can set a flag bit at the end of js execution, and then you can associate this flag bit through the ng-if/ng-show command to control the display of page elements. If it is more complicated, you can refer to the official Wiki to set the switching animation of ui-view

    reply
    0
  • 怪我咯

    怪我咯2017-05-16 13:21:47

    When binding, use ng-bind to bind, or use ng-cloak to process, you can take a look at it in detail

    reply
    0
  • Cancelreply