Pages
    • GETTING STARTED
        • API REFERENCE
                                                                                                                                              • COMMAND LINE
                                                                                                                                                  On this page

                                                                                                                                                        .rect()

                                                                                                                                                        This method is used to obtain the rendered rectangle of an element in the UI for manipualtion. It is an alias of the UIRect.calculate() function.

                                                                                                                                                        Syntax

                                                                                                                                                        let rect = $(el).rect(params = {});

                                                                                                                                                        Parameters

                                                                                                                                                        Return

                                                                                                                                                        • rect: UIRect - An instance of UIRect.

                                                                                                                                                        Usage

                                                                                                                                                        Get the rect of a button element.

                                                                                                                                                        let rect = $('button').rect();

                                                                                                                                                        Manipulate the rect.


                                                                                                                                                        Static Usage

                                                                                                                                                        The .rect() instance method is internally based on the standalone ui/rect() function which may be used statically.

                                                                                                                                                        Import

                                                                                                                                                        const { rect } = $.ui;
                                                                                                                                                        import { rect } from '@webqit/playui-js/src/ui/index.js';

                                                                                                                                                        Syntax

                                                                                                                                                        See the general way to use Play UI's standalone functions