Show an animation before show my index.html

时间秒杀一切 提交于 2020-01-03 04:43:30

问题


I have a website, with few content. So, it loads fast in the navigator. I want to load an jquery animation before show the first index.htm.
Sincerely I don't know how implement this idea. I don't want that the user clicks in the animation to continue to the main site. I want make an animation of 'x' time and when it finish, charges automatically the next html, or the rest of the page.

Thanks very much.


回答1:


Change your page the way that it loads all content at once including the animation. But the main content is hidden (e.g. by inline CSS) and the animation block is shown. Once your animation is done hide the animation block and show main content instead. As simple as that. This also gives browser enough time to render main content while it plays your animation.

Or option 2 - load index.html with animation only and then load content via AJAX while animation is playing into hidden element.

I would provide an example code if i had laptop or PC at hand, but basic sequence should obvious




回答2:


And what about using frames / iframes? Have a simple page with jquery or any other animation and inside this page have a iframe. When iframe is loaded, hide a animation. When iframe is not loaded - show a animation.

I suppose that you want to display some ads in animation. So, then you can create condition - set min time of displaying.



来源:https://stackoverflow.com/questions/22090313/show-an-animation-before-show-my-index-html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!