Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

msSiteModeShowButtonStyle Method

New for Windows Internet Explorer 9

Changes the icon image and tooltip of a Thumbnail Toolbar button.

Syntax

window.external.msSiteModeShowButtonStyle(uiButtonID, uiStyleID)

Parameters

uiButtonID Required. The ID of a button that is previously installed with msSiteModeAddThumbBarButton.
uiStyleID Required. The style ID that msSiteModeAddButtonStyle returns.

Return Value

No return value.

Remarks

The original icon and tooltip are assigned to Style 0; you can reset to the original button style by passing 0 in the uiStyleID parameter. Applying a button style will also reset the button state to active and visible.

Example

The following script changes the Thumbnail Toolbar button style depending on whether an audio control is playing or paused. The value of stylePlay and stylePause are set by a prior call to the msSiteModeAddButtonStyle method.



function playPause() {
    var audio = document.getElementById("myAudioElement");

    if (audio.paused) {
        audio.play();
    }
    else {
        audio.pause();
    }

    try {
        if (window.external.msIsSiteMode()) {
            if (audio.paused) {
                window.external.msSiteModeShowButtonStyle(btnPlayPause, stylePlay);
            }
            else {
                window.external.msSiteModeShowButtonStyle(btnPlayPause, stylePause);
            }

        }
    }
    catch (e) {
        // Fail silently.
    }
} 

Applies To

external

See Also

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.