Skip to content
View in the app

A better way to browse. Learn more.

MagicDuel Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Preloader?

Featured Replies

So as I continually increase the amount of pure text that the Oak Log holds, I'm starting to realize that in a few months it could become quite a bit to load, especially on a slow computer.

So to bide someone's time, does anybody know how to create a preloader? Something of the sort?

I'd be willing to pay.

Awi

Awiiya and I discussed this, for those interested in the code here it is:
[code]
<script type="text/javascript">
window.onload = function(){
document.getElementById("loader").style.display="none";
document.getElementById("content").style.display="block";
}
</script>
<div id="loader" style="text-align:center">
Loading...<br />
<img src="http://en9.tribalwars.net/graphic/throbber.gif" />
</div>
<div id="content" style="display:none">
Your content etc
<iframe src="etc etc">Your browser does not support iframes</iframe>
</div>
[/code]

If the page loads fast enough, the preloader is not even seen. If you WANT it to be seen, add a setTimeout to the onload (I will add an example of this if someone would like it)
For cool fade effects use a javascript library like jquery.

Here's the setTimeout, change the <script> to reflect this:[code]
<script type="text/javascript">
function loaded(){
document.getElementById("loader").style.display="none";
document.getElementById("content").style.display="block";
}
window.onload = function(){
setTimeout ("loaded()", 4000);
}
</script>[/code]
The 4000 is number of miliseconds to wait (4 seconds)

Edited by Rendril

  • Author

Success!

As a sidenote, anything can be used as the gif. There are lots of free ones out on the internet for some personalization.

Awi

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Forum Statistics

  • Total Topics 17.5k
  • Total Posts 182.2k

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.