Reference Guide
Reference Guides / JavaScript API / Events / RegisterOnFullscreenModeChanged
In This Topic
    In This Topic

    This function allows you to trigger a function of your own when an annotation has been added.

    RegisterOnFullscreenModeChanged: function (docuViewareID, callback)


    The identifier for the DocuVieware™ instance.
    The function you want to execute on event.
    The callback provides an argument having a prototype { newMode }.
    - newMode is a boolean value: true when the fullscreen mode has been turned on, false when it has been turned off.

    Return Value

    1 if error.

    Example of usage

    This JavaScript makes sure the DocuVieware control is properly loaded and initialized and then subscribes to the event on load to display the fullscreen state in the console.

    function RegisterOnFullscreenModeChangedOnDocuViewareAPIReady() {
        if (typeof DocuViewareAPI !== "undefined" && DocuViewareAPI.IsInitialized("DocuVieware1")) {
            DocuViewareAPI.RegisterOnFullscreenModeChanged("DocuVieware1", function (state) { console.log(state); });
        else {
            setTimeout(function () { RegisterOnFullscreenModeChangedOnDocuViewareAPIReady() }, 10);
    document.addEventListener("DOMContentLoaded", function () {
    }, false);