I have the following code :
<style>
#items {width:300px;}
.item {width:100px;border:solid 1px #ccc;float:left;height:20px;overflow:hidden;}
.item:hover{height:auto}
</style>
<div id="items">
<div class="item">text 1<br>text 1<br>text 1</div>
<div class="item">text 2<br>text 2<br>text 2</div>
<div class="item">text 3<br>text 3<br>text 3</div>
<div class="item">text 4<br>text 4<br>text 4</div>
<div class="item">text 5<br>text 5<br>text 5</div>
<div class="item">text 6<br>text 6<br>text 6</div>
<div class="item">text 7<br>text 7<br>text 7</div>
<div class="item">text 8<br>text 8<br>text 8</div>
<div class="item">text 9<br>text 9<br>text 9</div>
<div class="item">text 10<br>text 10<br>text 10</div>
</div>
see it in action :
http://jsfiddle.net/6K7t4/
when a div id hovered, it should expand without displacing other divs as shown at :
http://shopping.kelkoo.co.uk/ss-shirt.html
Also, please suggest how to achieve a cross-browser solution.
If it can be done using pure css, I prefer that solution.
If not, can it be done using jquery in an easy way without plugins?
See this demo: http://jsfiddle.net/6K7t4/24/
HTML:
CSS:
Each
.itemis now positioned relatively and has new child which wraps all content inside it. Once div is hovered,.item‘soverflow:hiddenis changed tooverflow:visibleand z-index of.inneris set to 100 (in order to show it above other divs).UPD: New demo and updated code. For IE7 (z-index is changed for .item:hover, otherwise inner div is hidden below other
.items in IE7)