javascript backgroundAttachment


  Résultats de traduction:

fond

anglais[ˈbækgraʊnd] américain[ˈbækˌɡraʊnd]

(peinture, etc.) couleur d'arrière-plan;

anglais[ə ˈtætʃmənt]美[ əˈtætʃmənt]

n. (envoyé par e-mail) pièces jointes, pièces jointes, saisie de biens <Loi>

javascript backgroundAttachmentsyntaxe

Fonction : Définissez si l'image d'arrière-plan est fixe ou défile avec le reste de la page.

Syntaxe : Object.style.backgroundAttachment=scroll|fixed

Remarques : Veuillez définir une couleur d'arrière-plan disponible, de sorte que si l'image d'arrière-plan n'est pas disponible, la page puisse également obtenir de bons effets visuels.

javascript backgroundAttachmentexemple

<html>
<head>
<style type="text/css">
body
{
background-color="#FFCC80";
background-image:url(http://img.php.cn/upload/article/000/005/656/5af270fd37755429.jpg);
}
p
{
color:white;
}
</style>
<script type="text/javascript">
function changeAttachment()
{
document.body.style.backgroundAttachment="fixed";
}
</script>

</head>
<body>

<input type="button" onclick="changeAttachment()"
value="Set background-image to be fixed" />
<p>This is a paragraph</p>
<p>This is a paragraph</p>
<p>This is a paragraph</p>
<p>This is a paragraph</p>
<p>This is a paragraph</p>
<p>This is a paragraph</p>
<p>This is a paragraph</p>
<p>This is a paragraph</p>
<p>This is a paragraph</p>
<p>This is a paragraph</p>
<p>This is a paragraph</p>
<p>This is a paragraph</p>
<p>This is a paragraph</p>
<p>This is a paragraph</p>

</body>
</html>

Exécuter l'instance »

Cliquez sur le bouton « Exécuter l'instance » pour afficher l'instance en ligne

Maison

vidéos

Questions et réponses