Comment changer l'image de fond d'un site ???
BenjD90
Messages postés
98
Statut
Membre
-
BenjD90 Messages postés 98 Statut Membre -
BenjD90 Messages postés 98 Statut Membre -
Bonjour,
Je cherche Comment changer la couleur de fond du site comme sur msn.com ou sur http://xpcoccinelle.fredisland.net/forum/?
En cliquant sur une image, par exemple, l'image de fond change.
J'ai déjà trouvé ce script :
<html>
<!-- Author: HackTrack -->
<head>
<title>Démo de sélection de couleur de fond</title>
<script language="javascript" type="text/javascript">
function changeBackgroundColor(elm){
window.status=elm.style.backgroundColor;
document.body.style.backgroundColor=elm.style.backgroundColor;
}
</script>
<style>
table, tr, td{
margin: 0px;
padding:0px;
border: solid 1px #0f0f0f;
}
div{
width: 50px;
height: 50px;
}
</style>
</head>
<body>
<table>
<tr>
<th colspan="4">Choisissez la couleur de fond</th>
</tr>
<tr>
<td><div onclick="javascript: changeBackgroundColor(this);" style="background-color: #000000;"></div></td>
<td><div onclick="javascript: changeBackgroundColor(this);" style="background-color: #111111;"></div></td>
<td><div onclick="javascript: changeBackgroundColor(this);" style="background-color: #222222;"></div></td>
<td><div onclick="javascript: changeBackgroundColor(this);" style="background-color: #333333;"></div></td>
</tr>
<tr>
<td><div onclick="javascript: changeBackgroundColor(this);" style="background-color: #444444;"></div></td>
<td><div onclick="javascript: changeBackgroundColor(this);" style="background-color: #555555;"></div></td>
<td><div onclick="javascript: changeBackgroundColor(this);" style="background-color: #666666;"></div></td>
<td><div onclick="javascript: changeBackgroundColor(this);" style="background-color: #777777;"></div></td>
</tr>
<tr>
<td><div onclick="javascript: changeBackgroundColor(this);" style="background-color: #888888;"></div></td>
<td><div onclick="javascript: changeBackgroundColor(this);" style="background-color: #999999;"></div></td>
<td><div onclick="javascript: changeBackgroundColor(this);" style="background-color: #aaaaaa;"></div></td>
<td><div onclick="javascript: changeBackgroundColor(this);" style="background-color: #bbbbbb;"></div></td>
</tr>
<tr>
<td><div onclick="javascript: changeBackgroundColor(this);" style="background-color: #cccccc;"></div></td>
<td><div onclick="javascript: changeBackgroundColor(this);" style="background-color: #dddddd;"></div></td>
<td><div onclick="javascript: changeBackgroundColor(this);" style="background-color: #eeeeee;"></div></td>
<td><div onclick="javascript: changeBackgroundColor(this);" style="background-color: #ffffff;"></div></td>
</tr>
</table>
</body>
</html>
_____________________________________________________________________________
Mais je n'arrive pas à le modifier pour changer d'image de fond (pas la couleur), j'ai essayer de mettre:
<td><div onClick="javascript: changeBackgroundImage(this);" style="background-image: url(Images/1304_2.jpg);"></div></td>
Je découvre le javasrcipt.
Je cherche Comment changer la couleur de fond du site comme sur msn.com ou sur http://xpcoccinelle.fredisland.net/forum/?
En cliquant sur une image, par exemple, l'image de fond change.
J'ai déjà trouvé ce script :
<html>
<!-- Author: HackTrack -->
<head>
<title>Démo de sélection de couleur de fond</title>
<script language="javascript" type="text/javascript">
function changeBackgroundColor(elm){
window.status=elm.style.backgroundColor;
document.body.style.backgroundColor=elm.style.backgroundColor;
}
</script>
<style>
table, tr, td{
margin: 0px;
padding:0px;
border: solid 1px #0f0f0f;
}
div{
width: 50px;
height: 50px;
}
</style>
</head>
<body>
<table>
<tr>
<th colspan="4">Choisissez la couleur de fond</th>
</tr>
<tr>
<td><div onclick="javascript: changeBackgroundColor(this);" style="background-color: #000000;"></div></td>
<td><div onclick="javascript: changeBackgroundColor(this);" style="background-color: #111111;"></div></td>
<td><div onclick="javascript: changeBackgroundColor(this);" style="background-color: #222222;"></div></td>
<td><div onclick="javascript: changeBackgroundColor(this);" style="background-color: #333333;"></div></td>
</tr>
<tr>
<td><div onclick="javascript: changeBackgroundColor(this);" style="background-color: #444444;"></div></td>
<td><div onclick="javascript: changeBackgroundColor(this);" style="background-color: #555555;"></div></td>
<td><div onclick="javascript: changeBackgroundColor(this);" style="background-color: #666666;"></div></td>
<td><div onclick="javascript: changeBackgroundColor(this);" style="background-color: #777777;"></div></td>
</tr>
<tr>
<td><div onclick="javascript: changeBackgroundColor(this);" style="background-color: #888888;"></div></td>
<td><div onclick="javascript: changeBackgroundColor(this);" style="background-color: #999999;"></div></td>
<td><div onclick="javascript: changeBackgroundColor(this);" style="background-color: #aaaaaa;"></div></td>
<td><div onclick="javascript: changeBackgroundColor(this);" style="background-color: #bbbbbb;"></div></td>
</tr>
<tr>
<td><div onclick="javascript: changeBackgroundColor(this);" style="background-color: #cccccc;"></div></td>
<td><div onclick="javascript: changeBackgroundColor(this);" style="background-color: #dddddd;"></div></td>
<td><div onclick="javascript: changeBackgroundColor(this);" style="background-color: #eeeeee;"></div></td>
<td><div onclick="javascript: changeBackgroundColor(this);" style="background-color: #ffffff;"></div></td>
</tr>
</table>
</body>
</html>
_____________________________________________________________________________
Mais je n'arrive pas à le modifier pour changer d'image de fond (pas la couleur), j'ai essayer de mettre:
<td><div onClick="javascript: changeBackgroundImage(this);" style="background-image: url(Images/1304_2.jpg);"></div></td>
Je découvre le javasrcipt.
A voir également:
- Comment changer l'image de fond d'un site ???
- Changer dns - Guide
- Wannonce nouveau site - Guide
- Site de telechargement - Accueil - Outils
- Wannonce site fermé - Guide
- Libreoffice changer couleur fond - Guide
4 réponses
Salut,
Et avec ça?
Et avec ça?
function changeBackgroundImage(elm){
document.body.style.backgroundColor=elm.style.backgroundImage;
}
Merci, g trouvé
<script language="javascript" type="text/javascript">
function changeBackgroundImage(elm){
window.status=elm.style.backgroundImage;
document.body.style.backgroundImage=elm.style.backgroundImage;
}
</script>
, tu m'as mené sur la bonne voie
Au passage vous ne sauriez pas comment faire pour que ça ce prolonge sur la suite des pages visités ????????????
genre avec un cookie
<script language="javascript" type="text/javascript">
function changeBackgroundImage(elm){
window.status=elm.style.backgroundImage;
document.body.style.backgroundImage=elm.style.backgroundImage;
}
</script>
, tu m'as mené sur la bonne voie
Au passage vous ne sauriez pas comment faire pour que ça ce prolonge sur la suite des pages visités ????????????
genre avec un cookie