fortnox007 Posted February 8, 2011 Share Posted February 8, 2011 Hi all, i was wondering if there is a good/ better way to show the website, when it is fully loaded. I read this article: http://javascript.about.com/library/blanim02.htm and they come with 2 methods: wrap some object in a div with an id and set it to display:none in css. after that they differ: method 1does: <body onload="setObjVis('myobj','visible');"> second one does function start() { setObjVis('myobj','visible'); } window.onload = start; since the article is fairly old i was wondering if these methods are still good or if there is a better method of doing this. What i thought was wrap everything in a wrapper div and apply the above. Love to hear from some expert Quote Link to comment https://forums.phpfreaks.com/topic/227022-show-page-when-its-loaded/ Share on other sites More sharing options...
.josh Posted February 8, 2011 Share Posted February 8, 2011 as in, the whole page? That doesn't really make sense..you're basically asking "How do I wait until the page is loaded, to show the page?" Quote Link to comment https://forums.phpfreaks.com/topic/227022-show-page-when-its-loaded/#findComment-1171279 Share on other sites More sharing options...
fortnox007 Posted February 8, 2011 Author Share Posted February 8, 2011 hehe well i thought if i can do that, i can maybe add a cool effect of subtile fade in or something. But if you have good suggestions i happy to hear it. I just never work with javascript lol Quote Link to comment https://forums.phpfreaks.com/topic/227022-show-page-when-its-loaded/#findComment-1171290 Share on other sites More sharing options...
.josh Posted February 8, 2011 Share Posted February 8, 2011 So you want to do a splash or preloader screen? ugh, those are so annoying. You should stay away from doing that unless your site really is loading something that takes a good amount of time to load. But if you insist, it would be easier to give it its own page and then redirect to real page when it's done. Quote Link to comment https://forums.phpfreaks.com/topic/227022-show-page-when-its-loaded/#findComment-1171293 Share on other sites More sharing options...
fortnox007 Posted February 8, 2011 Author Share Posted February 8, 2011 no not those annoying things, pretty much like google does, all white and than fades in pretty fast. It's just that i really don't like pages as if it is being build up, certainly in a browser like opera it looks like it consists of bricks. So it's no reall splash page, but just a small effect to show all at the same time. (preferable with a little fade in like 0.4 ms) I just stumbled upon jquery, can you recommend that? Quote Link to comment https://forums.phpfreaks.com/topic/227022-show-page-when-its-loaded/#findComment-1171297 Share on other sites More sharing options...
fortnox007 Posted February 8, 2011 Author Share Posted February 8, 2011 woohoo i just made something awesome i think and it works. is this the right way? i put this in the <head></head> <style type="text/css"> #wrapper{display:none;} </style> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#wrapper").fadeIn("slow"); }); </script> <noscript><style type="text/css">#wrapper{display:block;}</style></noscript> Quote Link to comment https://forums.phpfreaks.com/topic/227022-show-page-when-its-loaded/#findComment-1171300 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.