views:

71

answers:

1

I want to show hidden div on hover of <div class="thumb"> and i have multiple div on page each thumb div has different content images. width is fix for all div but height of large div <div class="large" style="display:none"> can be extended upon content after the image inside div.

Text of h2 will be always the same in both div.

If mouse is inside <div class="large"></div> then the div should stay on screen.

<!-----------------  Small Boxes   ----------------->
<div class="thumb">
   <h2>Box1</h2>
   <img src="test_files/images/thumbnail/thumb1.png" />
</div>

<!-----------------  Large Boxes on hover  ----------------->
<div class="large" style="display:none">
   <h2>Box1</h2>
   <h3>Heading 3 (this text will come over the image)</h3>
   <img src="test_files/images/large/large1.png" />
   <p>
      Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum
   </p>
</div>

I just given a example of one div but in actual I will have multiple boxes on actual page.

Image to understand the question

alt text

In actual page I will have multiple boxe like this

alt text

+1  A: 
$('.thumb').mouseover(function() {
  $(this).next().css('display', 'block');
});

$('.thumb').each(function(i, item) {
    $(this).next().mouseout(function() {
       $(this).css('display', 'none');
    });
});
jcubic
Just tried this but `div#large` keep flashing when i keep and move mouse inside this.
metal-gear-solid
@jcubic - your code of 2nd attempt is not working at all. i'm using this http://pastesite.com/18523
metal-gear-solid
I tried your third try http://pastie.org/1141321 it's working but in IE8 it's still flashing
metal-gear-solid
maybe use mouseenter() and mouseleave() insted mouseover() and mouseout().
jcubic
It's working but not with multiple instances I've code like this http://pastie.org/1141431
metal-gear-solid
Will i have into set position into css for each box?
metal-gear-solid