SOLVED!!! SCROLL TO END OF THIS QUESTION!
As you can see here:
I've made a page with all the soundtracks of the show this website's about, but when I load it, the divs in the div that create the rows aren't displayed correctly until you hover one of that divs, than that particular one looks like it has to. I don't want that my visitors have to find out how they fix it and it's just irritating, so what to do about it.
DOM:
<body>
<div> <!--row wrapper-->
<div class="track"> <!--track information-->
<img src="" /> <!--album cover-->
<h3></h3> <!--artist-->
<p></p> <!--title-->
</div> <!--/track information-->
</div> <!--/row wrapper-->
<div> <!--row wrapper-->
<div class="track"> <!--track information-->
<img src="" /> <!--album cover-->
<h3></h3> <!--artist-->
<p></p> <!--title-->
</div> <!--/track information-->
</div> <!--/row wrapper-->
...
</body>
JS (jQuery):
$(document).ready(function() {
$('div.track').mouseenter(function() {
$(this).stop(); //stop previous animation
$(this).animate({height:'250'}); //expand, so title and artist will be visible.
});
$('div.track').mouseleave(function() {
$(this).stop(); //stop previous animation
$(this).animate({height:'160px'}); //enlarge the div to it's original size
});
});
css:
<style>
.track{
vertical-align:top;
margin-right: 26px;
background-color: #a90000;
padding: 10px;
width: 160px;
height: 160px;
overflow: hidden;
border-radius: 6px;
color: #fff;
cursor: default;
margin-bottom: 20px;
display: inline;
}
</style>
Solved! added
css:
.track {
float: left;
}
.row{
clear: left;
}
HTML:
<div class="row">
<div class="track"></div>
<div class="track"></div>
<div class="track"></div>
<div class="track"></div>
<div class="track"></div>
</div>
Thanx to hungerstar