2
I have this code (below), where I can create a random banner, but it is not responsive, or rather, the image is not responsive.
<style type="text/css">
.banner{
width:100%;
height: auto;
}
</style>
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
<body>
<div class="banner">
<a href="" class="random"></a>
</div>
<script>
var randomImage = {
paths: [
"http://ramosdesignservidor.com.br/teste/img/slide01.jpg",
"http://ramosdesignservidor.com.br/teste/img/slide02.jpg",
"http://ramosdesignservidor.com.br/teste/img/slide03.jpg",
],
generate: function(){
var path = randomImage.paths[Math.floor(Math.random()*randomImage.paths.length)];
var img = new Image();
img.src = path;
$("a.random").html(img);
$("a.random").attr("href", path);
}
}
randomImage.generate();
</script>
</body>
I need some help!
Can I make this banner responsive?