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 backgroundAttachment syntaxe
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 backgroundAttachment exemple
<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