A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://js.devexpress.com/Documentation/ApiReference/Common/Object_Structures/PositionConfig/ below:

Vue Common - Object Structures - positionConfig

Configures the position of an overlay element.

Assign this object to the position property of an overlay UI component (Popup, Popover, Tooltip, etc.).

To position an element, specify the my, at, and of properties. In the following code, the Popup UI component's left side is aligned with the target's right side. This configuration reads as follows: "place my left side at the right side of the #target element."

jQuery
$(function() {
    $("#popupContainer").dxPopup({
        // ...
        position: {
            my: "left",
            at: "right",
            of: "#target"
        }
    });
});
Angular
<dx-popup ... >
    <dxo-position
        my="left"
        at="right"
        of="#target">
    </dxo-position>
</dx-popup>
Vue
<template>
    <DxPopup ... >
        <DxPosition
            my="left"
            at="right"
            of="#target"
        />
    </DxPopup>
</template>

<script>
import 'devextreme/dist/css/dx.light.css';

import DxPopup, {
    DxPosition
} from 'devextreme-vue/popup';

export default {
    components: {
        DxPopup,
        DxPosition
    }
}
</script>
React
import React from 'react';

import 'devextreme/dist/css/dx.light.css';

import Popup, {
    Position
} from 'devextreme-react/popup';

class App extends React.Component {
    render() {
        return (
            <Popup ... >
                <Position
                    my="left"
                    at="right"
                    of="#target"
                />
            </Popup>
        );
    }
}
export default App;

You can use the offset property to further adjust the position.

Possible positions are limited by the Window. To limit them by another element, specify the boundary property. If actual boundaries should be narrower or wider than the boundary element, set the boundaryOffset.

When a specified position exceeds the boundaries, a collision occurs. Use the collision property to specify how such collisions should be resolved.

Specifies the target element's side or corner where the overlay element should be positioned.

To set this property, use an object with the x and y fields. These fields specify the target element's horizontal and vertical sides, respectively. Alternatively, you can use a string shortcut from the accepted values list.

jQuery
$(function() {
    $("#popupContainer").dxPopup({
        // ...
        position: {
            // ...
            at: "left top"
            // ===== or =====
            at: { x: "left", y: "top" }
        }
    });
});
Angular
<dx-popup ... >
    <dxo-position ...
        at="left top">
        <!-- or -->
        <dxo-at x="left" y="top"></dxo-at>
    </dxo-position>
</dx-popup>
Vue
<template>
    <DxPopup ... >
        <DxPosition
            at="left top">
            <!-- or -->
            <DxAt x="left" y="top" />
        </DxPosition>
    </DxPopup>
</template>

<script>
import 'devextreme/dist/css/dx.light.css';

import DxPopup, {
    DxPosition,
    DxAt
} from 'devextreme-vue/popup';

export default {
    components: {
        DxPopup,
        DxPosition,
        DxAt
    }
}
</script>
React
import React from 'react';

import 'devextreme/dist/css/dx.light.css';

import Popup, {
    Position,
    At
} from 'devextreme-react/popup';

class App extends React.Component {
    render() {
        return (
            <Popup ... >
                <Position
                    at="left top">
                    {/* or */}
                    <At x="left" y="top" />
                </Position>
            </Popup>
        );
    }
}
export default App;
ASP.NET MVC Controls
@(Html.DevExtreme().Popup()
    .Position(p => p
        .At(HorizontalAlignment.Left, VerticalAlignment.Top)
    )
)
@(Html.DevExtreme().Popup() _
    .Position(Sub(p)
        p.At(HorizontalAlignment.Left, VerticalAlignment.Top)
    End Sub)
)

A boundary element in which the overlay element must be positioned.

The boundary element limits possible positions for the overlay element. The default boundary element is Window. If actual boundaries should be narrower or wider than the boundary element, set the boundaryOffset. When a specified position exceeds the boundaries, a collision occurs.

For information on accepted value types, refer to the of property description.

Specifies the offset of boundaries from the boundary element.

The offset is specified in pixels. To set this property, use an object with the x and y fields. These fields specify horizontal and vertical offsets, respectively. Alternatively, you can use a string value that indicates the offsets separated by a whitespace character. A positive offset narrows the boundaries; a negative offset widens the boundaries.

In the following code, left and right boundaries are narrowed (x is 50), but top and bottom boundaries are widened (y is -50).

jQuery
$(function() {
    $("#popupContainer").dxPopup({
        // ...
        position: {
            // ...
            boundaryOffset: "50 -50"
            // ===== or =====
            boundaryOffset: { x: 50, y: -50 }
        }
    });
});
Angular
<dx-popup ... >
    <dxo-position ...
        boundaryOffset="50 -50">
        <!-- or -->
        <dxo-boundary-offset [x]="50" [y]="-50"></dxo-boundary-offset>
    </dxo-position>
</dx-popup>
Vue
<template>
    <DxPopup ... >
        <DxPosition
            boundary-offset="50 -50">
            <!-- or -->
            <DxBoundaryOffset :x="50" :y="-50" />
        </DxPosition>
    </DxPopup>
</template>

<script>
import 'devextreme/dist/css/dx.light.css';

import DxPopup, {
    DxPosition,
    DxBoundaryOffset
} from 'devextreme-vue/popup';

export default {
    components: {
        DxPopup,
        DxPosition,
        DxBoundaryOffset
    }
}
</script>
React
import React from 'react';

import 'devextreme/dist/css/dx.light.css';

import Popup, {
    Position,
    BoundaryOffset
} from 'devextreme-react/popup';

class App extends React.Component {
    render() {
        return (
            <Popup ... >
                <Position
                    boundaryOffset="50 -50">
                    {/* or */}
                    <BoundaryOffset x={50} y={-50} />
                </Position>
            </Popup>
        );
    }
}
export default App;
ASP.NET MVC Controls
@(Html.DevExtreme().Popup()
    .Position(p => p
        .BoundaryOffset(50, -50)
    )
)
@(Html.DevExtreme().Popup() _
    .Position(Sub(p)
        p.BoundaryOffset(50, -50)
    End Sub)
)

Specifies how to resolve collisions - when the overlay element exceeds the boundary element.

You can use the following collision resolution algorithms:

To set the collision property, use an object with the x and y fields. These fields specify how to resolve horizontal and vertical collisions, respectively. Alternatively, you can use a string shortcut from the accepted values list.

jQuery
$(function() {
    $("#popupContainer").dxPopup({
        // ...
        position: {
            // ...
            collision: "flip none"
            // ===== or =====
            collision: { x: "flip", y: "none" }
        }
    });
});
Angular
<dx-popup ... >
    <dxo-position ...
        collision="flip none">
        <!-- or -->
        <dxo-collision x="flip" y="none"></dxo-collision>
    </dxo-position>
</dx-popup>
Vue
<template>
    <DxPopup ... >
        <DxPosition
            collision="flip none">
            <!-- or -->
            <DxCollision x="flip" y="none" />
        </DxPosition>
    </DxPopup>
</template>

<script>
import 'devextreme/dist/css/dx.light.css';

import DxPopup, {
    DxPosition,
    DxCollision
} from 'devextreme-vue/popup';

export default {
    components: {
        DxPopup,
        DxPosition,
        DxCollision
    }
}
</script>
React
import React from 'react';

import 'devextreme/dist/css/dx.light.css';

import Popup, {
    Position,
    Collision
} from 'devextreme-react/popup';

class App extends React.Component {
    render() {
        return (
            <Popup ... >
                <Position
                    collision="flip none">
                    {/* or */}
                    <Collision x="flip" y="none" />
                </Position>
            </Popup>
        );
    }
}
export default App;
ASP.NET MVC Controls
@(Html.DevExtreme().Popup()
    .Position(p => p
        .Collision(PositionResolveCollision.Flip, PositionResolveCollision.None)
    )
)
@(Html.DevExtreme().Popup() _
    .Position(Sub(p)
        p.Collision(PositionResolveCollision.Flip, PositionResolveCollision.None)
    End Sub)
)

Specifies the overlay element's side or corner to align with a target element.

To set this property, use an object with the x and y fields. These fields specify the overlay element's horizontal and vertical sides, respectively. Alternatively, you can use a string shortcut from the accepted values list.

jQuery
$(function() {
    $("#popupContainer").dxPopup({
        // ...
        position: {
            // ...
            my: "left top"
            // ===== or =====
            my: { x: "left", y: "top" }
        }
    });
});
Angular
<dx-popup ... >
    <dxo-position ...
        my="left top">
        <!-- or -->
        <dxo-my x="left" y="top"></dxo-my>
    </dxo-position>
</dx-popup>
Vue
<template>
    <DxPopup ... >
        <DxPosition
            my="left top">
            <!-- or -->
            <DxMy x="left" y="top" />
        </DxPosition>
    </DxPopup>
</template>

<script>
import 'devextreme/dist/css/dx.light.css';

import DxPopup, {
    DxPosition,
    DxMy
} from 'devextreme-vue/popup';

export default {
    components: {
        DxPopup,
        DxPosition,
        DxMy
    }
}
</script>
React
import React from 'react';

import 'devextreme/dist/css/dx.light.css';

import Popup, {
    Position,
    My
} from 'devextreme-react/popup';

class App extends React.Component {
    render() {
        return (
            <Popup ... >
                <Position
                    my="left top">
                    {/* or */}
                    <My x="left" y="top" />
                </Position>
            </Popup>
        );
    }
}
export default App;
ASP.NET MVC Controls
@(Html.DevExtreme().Popup()
    .Position(p => p
        .My(HorizontalAlignment.Left, VerticalAlignment.Top)
    )
)
@(Html.DevExtreme().Popup() _
    .Position(Sub(p)
        p.My(HorizontalAlignment.Left, VerticalAlignment.Top)
    End Sub)
)

The target element relative to which the overlay element should be positioned.

This property accepts the following value types:

The following value types are more suitable for jQuery:

Specifies the overlay element's offset from a specified position.

The offset is specified in pixels. To set this property, use an object with the x and y fields. These fields specify horizontal and vertical offsets, respectively. Alternatively, you can use a string value that indicates the offsets separated by a whitespace character. A positive offset shifts the element to the right or down; a negative offset shifts it to the left or up.

In the following code, the overlay element is shifted 50 pixels to the right and 25 pixels up.

jQuery
$(function() {
    $("#popupContainer").dxPopup({
        // ...
        position: {
            // ...
            offset: "50 -25"
            // ===== or =====
            offset: { x: 50, y: -25 }
        }
    });
});
Angular
<dx-popup ... >
    <dxo-position ...
        offset="50 -25">
        <!-- or -->
        <dxo-offset [x]="50" [y]="-25"></dxo-offset>
    </dxo-position>
</dx-popup>
Vue
<template>
    <DxPopup ... >
        <DxPosition
            offset="50 -25">
            <!-- or -->
            <DxOffset :x="50" :y="-25" />
        </DxPosition>
    </DxPopup>
</template>

<script>
import 'devextreme/dist/css/dx.light.css';

import DxPopup, {
    DxPosition,
    DxOffset
} from 'devextreme-vue/popup';

export default {
    components: {
        DxPopup,
        DxPosition,
        DxOffset
    }
}
</script>
React
import React from 'react';

import 'devextreme/dist/css/dx.light.css';

import Popup, {
    Position,
    Offset
} from 'devextreme-react/popup';

class App extends React.Component {
    render() {
        return (
            <Popup ... >
                <Position
                    offset="50 -25">
                    {/* or */}
                    <Offset x={50} y={-25} />
                </Position>
            </Popup>
        );
    }
}
export default App;
ASP.NET MVC Controls
@(Html.DevExtreme().Popup()
    .Position(p => p
        .Offset(50, -25)
    )
)
@(Html.DevExtreme().Popup() _
    .Position(Sub(p)
        p.Offset(50, -25)
    End Sub)
)
Feel free to share topic-related thoughts here.
If you have technical questions, please create a support ticket in the DevExpress Support Center.
Thank you for the feedback!

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4