Javascript-HintergrundAttachment属性


  Übersetzungsergebnisse:

Hintergrund

Englisch[ˈbækgraʊnd] Amerikanisch[ˈbækˌɡraʊnd]

n. (Gemälde usw.) Hintergrund; Hintergrundfarbe; Hintergrundinformationen; Soundtrack

Anhang

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

n (per E-Mail gesendet) Anhänge, Pfändung; Beschlagnahme von Eigentum <Gesetz> Beschlagnahme (Person, Eigentum)

Plural: Anhänge

Javascript-HintergrundAttachment属性Syntax

Funktion: Legen Sie fest, ob das Hintergrundbild fest ist oder mit dem Rest der Seite scrollt.

Syntax: Object.style.backgroundAttachment=scroll|fixed

Hinweise: Bitte legen Sie eine verfügbare Hintergrundfarbe fest, damit die Seite auch gute visuelle Effekte erzielen kann, wenn das Hintergrundbild nicht verfügbar ist.

Javascript-HintergrundAttachment属性Beispiel

<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>

Instanz ausführen »

Klicken Sie auf die Schaltfläche „Instanz ausführen“, um die Online-Instanz anzuzeigen

Heim

Videos

Fragen und Antworten