cotonti.com : random logo css https://www.cotonti.com Останні повідомлення в темі Cotonti en Sat, 13 Dec 2025 11:43:37 -0000 elfrenazo very good code

]]>
Thu, 25 Жов 2012 05:49:38 -0000
musashi9 Excelent works like a charm, thanks!

]]>
Пт, 19 Жов 2012 16:48:02 -0000
GHengeveld Easiest solution is to use JavaScript:

<script type="text/javascript">
$(function() {
  var logos = ["../img/logo1.png", "../img/logo2.png", "../img/logo3.png"];
  $('#header').css('background-image', 'url(' + logos[Math.floor(Math.random()*logos.length)] + ')');
});
</script>

Put it in header.tpl, right before </head>

]]>
Пт, 19 Жов 2012 16:30:38 -0000
musashi9 Hello I want to load a random logo in my header but I have no idea how to

This is what I have in my css............

#header {
background: url(../img/logo2.png) no-repeat ;

background-color: #113355;
     width:1000px;
     height:181px;
    height: 278px;
}

and this is from my header.tpl............

<div id="header">
 

</div>

How can I get it to load a random image ?

]]>
Пт, 19 Жов 2012 11:54:08 -0000