You are here: Reference > JavaScript > client-side > event handling > events > onfinish

onfinish event | finish event

Browser support:
Occurs when a marquee element has finished the scrolling animation.

How to register:

In HTML:
<ELEMENT onfinish="handler">

In JavaScript:
object.onfinish = handler;
object.addEventListener ("finish", handler, useCapture);
9
object.attachEvent ("onfinish", handler);
You can find the related objects in the Supported by objects section below.
The event object is accessible to all event handlers in all browsers. The properties of the event object contain additional information about the current event. To get further details about these properties and the possible event handler registration methods, please see the page for the event object.
For a complete list of events, see the page for Events in JavaScript.

Basic information:

Bubbles No
Cancelable Yes
Event object Event

Actions that invoke the onfinish event:

  • When a marquee element finishes the scrolling animation.
Marquee specific events:
onbounce, onfinish, onstart.

Example HTML code 1:

This example illustrates the use of the onfinish event:
<head>
    <script type="text/javascript">
        function WriteInfo (event) {
            var marquee = event.target ? event.target : event.srcElement;
            var info = marquee.parentNode.getElementsByTagName ("div")[0];
            info.innerHTML += event.type + ", ";
        }
    </script>
</head>
<body>
    <div>
        behavior="alternate"<br />
        <marquee behavior="alternate" loop="3" width="300" style="border:1px solid red"
                onbounce="WriteInfo (event)" onfinish="WriteInfo (event)" onstart="WriteInfo (event)">
            Hi There!
        </marquee>
        <div style="color:blue"></div>
    </div>
    <br /><br />
    <div>
        behavior="scroll"<br />
        <marquee behavior="scroll" loop="3" width="300" style="border:1px solid red"
                onbounce="WriteInfo (event)" onfinish="WriteInfo (event)" onstart="WriteInfo (event)">
            Hi There!
        </marquee>
        <div style="color:blue"></div>
    </div>
    <br /><br />
    <div>
        behavior="slide"<br />
        <marquee behavior="slide" loop="3" width="300" style="border:1px solid red"
                onbounce="WriteInfo (event)" onfinish="WriteInfo (event)" onstart="WriteInfo (event)">
            Hi There!
        </marquee>
        <div style="color:blue"></div>
    </div>
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content