Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Apr 2004
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Disable link clicking until page loads

    Greetings

    I've been scouring the web for about the past hour looking for a script solution that will prevent clicking of any links until after the page fully loads up. Perhaps my Google skills are below par.

    Here's the deal. I use a product named RoboHelp HTML to create HTML Help files. This product has a really easy to use feature called a "DHTML Drop Down". Basically, you select the link text, click a button and add the text you want to appear when clicked, then click OK. RoboHelp handles inserting the code (stashing it in a hidden DIV) and has JavaScript behind the scenes to make the hidden DIV appear or disappear depending upon the state when the link is clicked upon. If you have inserted quite a few of these and the page is lengthy, the page may take a while to load up. If this is the case and a user clicks one of these links before the page loads completely, a JavaScript error is produced and prevents any of the other links from working until the page is reloaded. Hence my search for some scripting to prevent anything from occurring until the page is completely loaded.

    Any pointers to existing scripts would be appreciated. Thus far, all I can seem to find are scripts that prevent right clicking or scripts that handle allowing only a single click of a form submit button.

    Thanks in advance... Rick
    Last edited by RoboWizard; 04-27-2004 at 05:41 PM. Reason: Wanted E-Mail notification if post was replied to!

  • #2
    Senior Coder
    Join Date
    Feb 2004
    Location
    Edinburgh
    Posts
    1,352
    Thanks
    0
    Thanked 0 Times in 0 Posts
    can only point you in the right direction:

    suggestion number 1:
    use the document.readyState method to determine if the page has finished loading, and if so then execute the rest of your script.

    suggestion number 2:
    put an transparent image at the end of document, and use the image.complete method to determine if it has loaded, and then execute the rest of your script.

    these are only suggestions, however, and maybe not what you're looking for. basically, don't have the time to look into this properly

  • #3
    New Coder
    Join Date
    Mar 2004
    Posts
    78
    Thanks
    0
    Thanked 0 Times in 0 Posts
    jbot,

    I've encountered a similar problem while using a Macromedia's Halo CSS page template with dynamic server side content.

    Try manually moving the scripts to the top of the page under the <body> tag. That way the scripts are loaded before the links.

    Cheers,
    Simon


  •  

    Posting Permissions

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