A RetroSearch Logo

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

Search Query:

Showing content from https://webplatform.github.io/docs/css/cssom/properties/posTop below:

posTop · WebPlatform Docs

posTop Summary

Reflects the value of the Cascading Style Sheets (CSS) top attribute for positioned items.

Property of css/cssom/propertiescss/cssom/properties

Syntax
var result = element.posTop;
element.posTop = value;
Examples

This example uses the posTop property to move the first img object up by 10 units.

<SCRIPT LANGUAGE="JScript">
document.all.tags("IMG").item(0).style.posTop -= 10;
</SCRIPT>

This example uses a timer to change the value of the posTop in increments of 10.

<SCRIPT LANGUAGE="JScript">
function moveThis()
{
:
    if (sphere.style.posLeft<900) {
        sphere.style.posTop += 2;
        sphere.style.posLeft += 2;
        window.setTimeout("moveThis();", 1);
        }
}
:
</SCRIPT>

View live example

Notes Remarks

This property reflects the value of the Cascading Style Sheets (CSS) top attribute for positioned items. This property always returns zero for nonpositioned items because “top” has meaning only when the object is positioned. If the top attribute is not set, the posTop property returns zero. Use the offsetTop property to calculate actual positions within the document area. Setting this property changes the value of the top position but leaves the units designator for the property unchanged. Unlike the top property, the posTop property value is a floating-point number, not a string.

See also Related pages Attributions

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