1
vinit
How to show that content is loading?
  • 2004/6/17 2:10

  • vinit

  • Just can't stay away

  • Posts: 530

  • Since: 2004/1/10


In Many CMS while the content is loading it shows "Loading .." with some animation. is there anything like that in XOOPs to. i have seen it working in e-xoops or RUNCMS.

2
davidl2
Re: How to show that content is loading?
  • 2004/6/17 2:16

  • davidl2

  • XOOPS is my life!

  • Posts: 4843

  • Since: 2003/5/26



3
vinit
Re: How to show that content is loading?
  • 2004/6/17 9:19

  • vinit

  • Just can't stay away

  • Posts: 530

  • Since: 2004/1/10


What do i need to do to apply that loading functionality to x2t theme/template ???

i cannot replace my existing template. Any minor modification to the theme or template can be done.

4
vinit
Re: How to show that content is loading?
  • 2004/6/17 10:29

  • vinit

  • Just can't stay away

  • Posts: 530

  • Since: 2004/1/10


Ok got the solution,

Pasting it here for rest of the xoopsians..

Add the following lines into the theme.html

1. in <script> </script> section add the following lines
function xoopsGetElementById(id) {

if (document.getElementById(id)) {
return document.getElementById(id);
} else if (document.all[id]) {
return document.all[id];
} else if (document.layers && document.layers[id]) {
return (document.layers[id]);
} else {
return fake_element;
}
}

function toggle_visibility(id, flag) {

if (xoopsGetElementById(id)) {
xoopsGetElementById(id).style.visibility = (flag) ? 'visible' : 'hidden';
}
}


2. Just after <body> add the following code

<!-- Load indicatior -->
<div id="waitDiv" style="position:absolute; left:40%; top:50%; visibility:hidden; text-align:center;">
<table cellpadding="3" cellspacing="3" class="waitbox"><tr>
<td align="center">
<b><big>Loading...</big></b><br />
<img src="<{$xoops_imageurl}>await.gif" alt="" />
<br />Please Wait.</td></tr>
</table>

</div>
<script type='text/javascript'>
<!--
toggle_visibility('waitDiv', 1);
//-->
</script>

<!-- End Load Indicator -->

3. Just before </body> add the following lines

<!-- Page Loaded Indicator Stop -->

<script type='text/javascript'>
<!--
toggle_visibility('waitDiv', 0);
//-->
</script>
<!-- End -->

4. Copy await.gif to you theme/<selected theme> folder.

Thats done :)

Now everytime your page gets loaded you will see that image (await.gif) and the text loading.



Have fun. I hope some one add it into some faq or doc it.

5
Max-Realms
Re: How to show that content is loading?

This method DOES work! Note: the first part, put between the first set of <script></script> in the HEAD.

Thanks!

David Goodman
http://www.max-realms.com

6
Anonymous
Re: Need help with logo
  • 2005/5/2 14:16

  • Anonymous

  • Posts: 0

  • Since:


Thanks for the information.

Login

Who's Online

173 user(s) are online (131 user(s) are browsing Support Forums)


Members: 0


Guests: 173


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits