Connect to blogger presentation >> Edit HTML and find the following line:
]] > </ b: skin >
Paste the following code just before the line pécédente :
.bg1 {background : url (URL image1 ) repeat-x ; background- color: # 6c0000 ; }
.bg2 {background : url (URL image2 ) repeat-x ; background- color: # 5A2A00 ; }
.bg3 {background : url (URL image3 ) repeat-x ; background- color: # 00345B ; }
Image1 URL : replace with a small icon that reflects the color ( # 6c0000 red).
Image2 URL : replace with a small icon that reflects the color ( # 5A2A00 maroon ) .
Image3 URL : replace with a small icon that reflects the color ( blue # 00345B ) .
Then look for this line:
</ head>
And just before pasting the following code :
<script src = 'http: //ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js ' type = ' text / javascript ' /> <script type = 'text / javascript' >
$ (document ) .ready (function () {
$("li.one").click( function(){ $
("body").removeClass('bg2 , bg3').addClass("bg1");
});
$("li.two").click( function(){ $
("body").removeClass("bg1 , bg3").addClass("bg2");
});
$("li.three").click( function(){ $
("body").removeClass("bg1 , bg2").addClass("bg3");
});
});
</script>
Si vous utiliser déja jquery dans votre blog, pas la peine de coller la premiére ligne aussi.
Coller le code suivant dans votre blog, peut etre dans un message blogger(article), la barre latérale, ...
<ul>
<li class="one"><a href="#">Rouge</a></li>
<li class="two"><a href="#">Maron</a></li>
<li class="three"><a href="#">Bleur</a></li>
</ul>
Voila c'est tout est merci.
Home »
Blogging Tips
» Dynamically change the background color to blogger
Dynamically change the background color to blogger
By: Unknown on Tuesday, 27 January 2015 | 10:05
Subscribe to:
Post Comments (Atom)
Post a Comment