#Loading is a div which contains a loading jpeg which is fixed to the bottom of the screen. This div appears when the user hits the bottom of the screen, and then disappears once the content has fully loaded.

The problem I have is that once the user has loaded all the content that is available. Say I have 'page2.html, page3.html, page4.html' to load one at a time as the user hits the bottom of the screen. I need the loading bar to stay hidden when it tries to load the 'page5' which does not yet exist...

Is this easy to do to alter my javascript code?

I am at a loss with this. Any help would be appreciated. I asked a similar question before but have adapted the code now for the loading bar, just need this little glitch to be fixed.

Thank you!

Website at:

www.jb-design.me/marchupdate2/

so you can see that I mean. (note that the graphics on the website are made by me but are not my work, just for placement)

sunfighter

03-18-2012, 06:25 PM

$('element').length == 0; means no element found
if ($('element').length) { means the element was found

Use either line to show/not show your loading image

jbyrne

03-18-2012, 07:04 PM

$('element').length == 0;

^^ isn't this to say whether it is currently available on the page?
I could be wrong. Can it be used to search the index folder of the website, to try to find the next 'page#.html' '# meaning number'

Just like "var url = "page"+nextpage+".html";" does?

Thanks for the reply though!

jbyrne

03-18-2012, 10:35 PM

Solved by using ajax instead. was able to use the error and complete function to do what i wanted! Thanks for your help