Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi all! We have been experiencing an issue on site where threads have been missing the latest postings. The platform host Vanilla are working on this issue. A workaround that has been used by some is to navigate back a page or two to re-sync the thread and this will then show latest posts. Thanks, Mike.

Javascript Overlay - Jquery

  • 27-03-2009 2:39pm
    #1
    Registered Users Posts: 123 ✭✭


    Hi,

    I'd like to get an overlay working on a webpage.

    I have been able to install jquery overlay on the page and can get it to work when a button is clicked, what I want to do is get it to open when the page loads.

    I have tried putting the relative function in the body:
    <body onLoad="openOverlay()"> to no avail

    I also tried calling it after the function has been declared to no avail,
    Did the same within the body of the html.

    here are the two functions that can trigger the box:

    $(function() {
    $("button[rel]").overlay();
    });

    The button that opens this:
    <button type="button" rel="#overlay">Open overlay</button>

    function openOverlay() {

    // get access to the overlay API
    var api = $("#overlay").overlay();

    // call it's open() method
    api.load();
    }


    The button that opens this:
    <button type="button" onClick="openOverlay()">Open overlay</button>

    I would like either of those functions to be triggered when the page loads/opens.

    Can this be done in the HTML or is it something that I would need to add intot the attached javascript (jquery_002.js and jquery.js)

    Any suggestions appreciated
    If you need any further information please let me know.

    Here is the site that has it:

    http://flowplayer.org/tools/archive/overlay-0.14.html


Comments

  • Closed Accounts Posts: 18,163 ✭✭✭✭Liam Byrne


    Firstly, make sure openOverlay is defined before it's referenced (but after its JavaScript/include files

    Secondly, add openOverlay() to a jQuery $(document).ready() function


Advertisement