Dealing with the flicker of unstyled content in my kendo mobile web app has been a challenge, but I found a solution by using a specific CSS rule within my stylesheet:
[data-role="content"]
{
visibility: hidden;
}
This effectively hides all content within my kendo views, and then in the JQuery "load" event, I remove the CSS attribute to reveal the content:
$(window).bind("load", function () {
// flicker of unstyled content
$("[data-role=\"content\"]").css("visibility", "visible");
});
This method worked well until I encountered issues when utilizing kendo's view transitions.
During the slide:left
transition, the original visibility: hidden;
from my CSS file is reapplied, making everything invisible again.
I'm curious if this behavior is specific to kendo and how it handles views and transitions. While I could manually add a class with visibility: hidden;
to each data-role="content"
element and remove it in the "load" event handler, I prefer a less hardcoded approach.
Any insights or suggestions would be greatly appreciated.