PP.reallyOut

Syntax

reallyOut(element: HTMLDocument, event);

Parameters

element. DOM element.

event. Mouse cursor event.

Description

The reallyOut method determines whether the mouse cursor has really quitted the specified element or moved from one child element to another.

Comments

This method returns True if the mouse cursor has quitted the specified element or moved from one child element to another, otherwise it returns False.

Example

To execute the example, the HTML page must contain links to the PP.js scenario file and the PP.css styles file. Create a text area and color this area in yellow if the mouse cursor is within this area, or in red if the cursor has left this area:

// Create a text area
var textArea = new PP.Ui.TextArea({
    ParentNode: document.body,
    Width: 250,
    Height: 100,
    Style: "background-color: #ff0000;"
});
// Process the MouseOver event
textArea.MouseOver.add(function (sender, args) {
    // Get DOM element of text area
    var dom = sender.getDomNode();
    if (PP.reallyOver(dom, PP.fixEvent(args.Event, dom))) {         /* Color the text area in yellow if the mouse cursor is over the text area */         textArea.setStyle("background-color: #ffff00;")         //In order the text area width does not extend to fit the entire screen
        dom.style.width = "250px";
    }; }); // Process the MouseOut event textArea.MouseOut.add(function (sender, args) {     // Get DOM element of text area     var dom = sender.getDomNode();
    if (PP.reallyOut(dom, PP.fixEvent(args.Event, dom))) {         /* Color the text area in red if the mouse cursor is outside the text area */         textArea.setStyle("background-color: #ff0000;")         //In order the text area width does not extend to fit the entire screen
        dom.style.width = "250px";
    }; });

After executing the example the text area is filled with yellow color if the mouse cursor is within this area:

If the cursor has left the text area, it is filled with red color:

See also:

PP