HTML DOM backgroundPositionX Property
Complete Style Object Reference
Definition and Usage
The backgroundPositionX property sets the horizontal position of a background-image.
Syntax
Object.style.backgroundPositionX=position
|
Parameter |
Description |
left
center
right |
Horizontal position |
x% |
Horizontal position. Left is 0%. Right
is 100% |
xpos |
Horizontal position . Left is 0. Units can be
pixels (0px) or any other CSS units |
Example
The following example changes the horizontal position of the background-image:
<html>
<head>
<style type="text/css">
body
{
background-color:#FFCC80;
background-image:url(bgdesert.jpg);
background-repeat:no-repeat
}
</style>
<script type="text/javascript">
function changePosition()
{
document.body.style.backgroundPositionX="right";
}
</script>
</head>
<body>
<input type="button" onclick="changePosition()"
value="Change background-image's x-position" />
</body>
</html>
|
Try-It-Yourself Demos
Change the horizontal position of a background-image
Complete Style Object Reference
Learn how your website performs under various load conditions
|
|
WAPT
is a load, stress and performance testing tool for websites and web-based applications.
In contrast to "800-pound gorilla" load testing tools, it is designed to minimize the learning
curve and give you an ability to create a heavy load from a regular workstation.
WAPT is able to generate up to 3000 simultaneously acting virtual users using standard hardware configuration.
Virtual users in each profile are fully customizable. Basic and NTLM authentication methods are supported.
Graphs and reports are shown in real-time at different levels of detail, thus helping to manage the testing process.
Download the free 30-day trial!
|
|