Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

Thread: Preloader (CSS Spinner) and SSI script II

  1. #11
    Join Date
    Jul 2012
    Posts
    24
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    *You do want it to show initially and then disappear when the page loads - right?
    No, it should always be hidden, like a cosmic joke :-)

    I repaired the bug in my markup immediately when you told me about it -- some hours ago!
    I don't know, why you still see it. Pls clear the browsers cache, and again: I'm sorry.

    It's (for some time): <div id="preloader" style="display: none; opacity: 0.7;">
    ...
    </div>

    If I erase style="display: none", the CSS animation shows, and the idea of this little script
    (got it from a tutorial of an Indian developer that I found in YouTube) is to control the hide/show of the id "preloader" with Javascript.

    I use this (your) code (at the moment, in the head, before the SSI-script):
    Code:
    window.addEventListener('load', function(){
    	var overlay = document.getElementById('preloader');
    	overlay.style.display = 'none';
    }, false);
    Nothing happens, and I believe I have been careful.

    Maybe it's because of the SSI-II-script.
    Maybe this page get's loaded superfast anyway, and we don't know anything here about the shop-CMS that's loading boringly slow.
    Maybe it's in vain.
    Maybe it would only work if it would be included in the SSI-II script.
    Last edited by wol4; 09-04-2016 at 07:38 PM.

  2. #12
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    OK all fixed that I can see now except:

    Code:
    <div id="preloader"  style="display: none; opacity: 0.7;">
    Gotta get rid of that (highlighted), or we will never see it.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #13
    Join Date
    Jul 2012
    Posts
    24
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    I've done that, but now we always see it :-)

    The idea of that code is to switch it on and off at pageload. It doesn't.
    Maybe it has to be inside of the SSI II - script?

  4. #14
    Join Date
    Jul 2012
    Posts
    24
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    I understand. Thank you, John, for having a close look at this!
    Maybe I'll have to talk to the YooThemes ...

  5. #15
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    OK, I've got it. The onload is firing. The script tag is invalid:

    Code:
    <script type="javascript">
    window.addEventListener('load', function(){
    	document.getElementById('preloader').style.display = 'none';
    }, false);
    </script>
    Should be:

    Code:
    <script>
    window.addEventListener('load', function(){
    	document.getElementById('preloader').style.display = 'none';
    }, false);
    </script>
    The page does have other invalid code though, illegal nesting should probably be fixed, the outdated attributes on the iframe are probably harmless, and might actually be good for some browsers. Missing alt attributes on images are also optional fixes, as an empty alt attribute is valid. Those are mostly for people with screen readers (blind). So it's nice to have them. And they can be useful if an image fails to load.
    Last edited by jscheuer1; 09-05-2016 at 03:41 PM. Reason: add last paragraph
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. The Following User Says Thank You to jscheuer1 For This Useful Post:

    wol4 (09-05-2016)

  7. #16
    Join Date
    Jul 2012
    Posts
    24
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    Yeah!

  8. #17
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    OK, now what would be nice would be to have it reappear when a link is clicked that loads new content into the iframe and then have it disappear again once that content is loaded. Compared to what we've just been through, this should be relatively easy. Are you game?
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  9. #18
    Join Date
    Jul 2012
    Posts
    24
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    Playful you :-)
    It's cool for now, and I will focus on technical issues now.

    But it's so important to have a little fun while working on the heavvy stuff, right?
    Thank you, I'll be back!

    And this is a very honorable address ... :-)

Similar Threads

  1. how to display spinner buttons in another table
    By manleybruce in forum JavaScript
    Replies: 0
    Last Post: 12-06-2011, 09:37 AM
  2. spinner
    By thimmappa449 in forum JavaScript
    Replies: 1
    Last Post: 10-20-2010, 09:02 AM
  3. displaying a spinner for loading purpose
    By gargidas15 in forum Flash
    Replies: 1
    Last Post: 04-29-2009, 06:12 PM
  4. preloader script
    By bartjr in forum Looking for such a script or service
    Replies: 0
    Last Post: 02-10-2009, 12:07 AM
  5. DD Preloader Script
    By evilburn in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 12-15-2004, 04:17 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •