The Joomla! Forum ™



Forum rules


Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.



Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Tue Jan 30, 2007 8:20 am 
User avatar
Joomla! Explorer
Joomla! Explorer

Joined: Mon Apr 03, 2006 4:04 pm
Posts: 432
Location: Germany
Hi people!
I am trying to make a progress bar appear on my site as long as the page is loading, as i use some ajax lightbox stuff that does not work before page is fully loaded.

I tried with this script in my template index.php:
Code:
TEMPLATE HEAD



<body style="background: #012f85;" onLoad="init()">

<div id="loading" style="position:absolute; width:100%; text-align:center; top:300px;"><img src="images/loading.gif" border=0></div>
<script>
var ld=(document.all);

var ns4=document.layers;
var ns6=document.getElementById&&!document.all;
var ie4=document.all;

if (ns4)
   ld=document.loading;
else if (ns6)
   ld=document.getElementById("loading").style;
else if (ie4)
   ld=document.all.loading.style;

function init()
{
if(ns4){ld.visibility="hidden";}
else if (ns6||ie4) ld.display="none";
}
</script>



MY ACTUAL TEMPLATE BODY



</body>
</html>


Unfortunately the loading gif never stops loading although the page is finished.. Any idea why that is?
Does anybody have another solution at hand maybe?

Thx
Fabs

_________________
Please visit my personal website and leave many traces ;)
http://www.ffaabbiiaann.de
If you need webdesign services I can help you out:
http://www.webdesign2punkt0.de


Top
 Profile  
 
PostPosted: Thu Feb 01, 2007 12:11 am 
Joomla! Ace
Joomla! Ace

Joined: Tue Nov 14, 2006 3:19 am
Posts: 1055
Location: Portland, OR USA
The only thing I can think of is to check the various "on*" event triggers to see if any of them fire when the page loading is complete.

_________________
Keith Watson


Top
 Profile  
 
PostPosted: Thu Feb 01, 2007 4:05 am 
User avatar
Joomla! Explorer
Joomla! Explorer

Joined: Mon Apr 03, 2006 4:04 pm
Posts: 432
Location: Germany
Thanks for trying to help me out here!

I copied the script from a live site and it was working perfectly fine there:
http://www.reconn.us/wait_demo.html

so how would i proceed to see where the error is... i did not change a thing in the script?!

thx
Fabs

_________________
Please visit my personal website and leave many traces ;)
http://www.ffaabbiiaann.de
If you need webdesign services I can help you out:
http://www.webdesign2punkt0.de


Top
 Profile  
 
PostPosted: Fri Feb 02, 2007 3:12 am 
Joomla! Ace
Joomla! Ace

Joined: Tue Nov 14, 2006 3:19 am
Posts: 1055
Location: Portland, OR USA
Thank you for a live example.  Seeing it in action now I see what it is doing.  Your copy looks correct.  What browser is it not working in?

Have you done any Javascript programming or debugging before?

_________________
Keith Watson


Top
 Profile  
 
PostPosted: Fri Feb 02, 2007 11:16 am 
User avatar
Joomla! Explorer
Joomla! Explorer

Joined: Mon Apr 03, 2006 4:04 pm
Posts: 432
Location: Germany
NO programming or hardly. I just read some tutorials to basically get to  knwo javascript and understand how commands are structured and what means what more or less.... But apart from that I am just a copy&paste artist... that is why I am so lost...

The example site worked in FF but on my Site in FF it did not... the loading gif just never dissappeared on my site... i tried it on severeal of my pages  but no luck... might there be a conflict with other javascript on my site? How could i solve that?

Maybe somebody could review the javascript i already have to see whether it could produce and error or incompatiblility with the code above?

thanks so much kwak for helping!
fabs

_________________
Please visit my personal website and leave many traces ;)
http://www.ffaabbiiaann.de
If you need webdesign services I can help you out:
http://www.webdesign2punkt0.de


Top
 Profile  
 
PostPosted: Sat Feb 03, 2007 5:03 am 
Joomla! Ace
Joomla! Ace

Joined: Tue Nov 14, 2006 3:19 am
Posts: 1055
Location: Portland, OR USA
I don't know how much I can really help on this.  Since it happens in FF (aka NS6) the Javascript is doing the right thing in specifically trying to hide the "loading" element.  But just because it "looks" correct doesn't mean something else is going on.  And I don't have experience with using a debugger to run a Javascript.  That would be something to look into.

Otherwise we'll have to wait until someone with some Javascript debugging experience sees this thread.

_________________
Keith Watson


Top
 Profile  
 
PostPosted: Thu Jun 07, 2012 12:03 pm 
Joomla! Fledgling
Joomla! Fledgling

Joined: Thu Jun 07, 2012 11:59 am
Posts: 1
Finally a code I can use, It works perfectly....at first it messed with my background so I removed style="background: #012f85;"

Here's a look at it, http://www.qualitylist.org/web-designers

My site loads a bit slow due to google adsense so your code came in handy!
I just added it to my index php and created an image, that simple!

Next is, I don't want it on every page of my site so I'll have to see where I can place it on a specific module :pop


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 



Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group