Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
You are here: Reference > JavaScript > client-side > style handling > properties > browser specific extensions > XvVoiceDuration

XvVoiceDuration style property

Browser support:
Specifies or retrieves how long a given element is to be rendered.
Same as the voice-duration property in the CSS3 declaration.

Syntax:

object.XvVoiceDuration;
You can find the related objects in the Supported by objects section below.
This property is read/write.
CSS page for this property: -xv-voice-duration

Possible values:

The type of this property is string.
 One of the following values: 
inherit
Takes the value of this property from the computed style of the parent element.
time(s|ms)
Integer, followed by a time unit (s,ms).
Default: this property has no default value.

Example HTML code 1:

This example illustrates the use of the -xv-voice-duration property:
<head>
    <style>
        .example {
            -xv-voice-duration: 220ms;
        }
    </style>
</head>
<body>
    Normal duration
    <p class="example">voice-duration: 220ms</p>
    Select the text above, right click and select speak
</body>
Did you find this example helpful? yes no

Example HTML code 2:

This example illustrates the use of the XvVoiceDuration property in JavaScript:
<head>
    <style>
        #example {
            -xv-voice-duration: 220ms;
        }
    </style>
    <script type="text/javascript">
        function ChangeDuration (selectTag) {
            var example = document.getElementById ("example");

            // Returns the index of the selected option
            var whichSelected = selectTag.selectedIndex;

            // Returns the text of the selected option
            var selectState = selectTag.options[whichSelected].text;

            if ('XvVoiceDuration' in example.style) {
                example.style.XvVoiceDuration = selectState + "ms";
            } else {
                alert ("Your browser doesn't support this example!");
            }
        }
    </script>
</head>
<body>
    Normal duration
    <p id="example">custom duration</p>

    Select the text above, right click and select speak, or change duration:
    <select onchange="ChangeDuration (this);" size="5">
        <option>30</option>
        <option>60</option>
        <option>120</option>
        <option>180</option>
        <option selected="selected">220</option>
    </select>
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content