1

Here is the code: http://jsfiddle.net/pfaUZ/5/

When I click li the pop div showing fully overlaying two li (exmpl: li width 100px, pop width 200px;) but if u test in ie7 its not working:

see: enter image description here

test
  • 2,429
  • 15
  • 44
  • 81

3 Answers3

1

See: http://jsfiddle.net/thirtydot/pfaUZ/11/

You can fix this IE7 bug by ensuring that only the "active" li has position: relative:

$('li').click(function() {
    $('.pop').hide();
    $(this).find('.pop').show();

    $('li').css('position', 'static');
    $(this).css('position', 'relative');
});

I also changed to .hide() and .show(). Those methods are equivalent to what you were using.

There might be a pure CSS fix, which would be more desirable, but I can't find it.

Community
  • 1
  • 1
thirtydot
  • 224,678
  • 48
  • 389
  • 349
0

Try like that

$('li').click(function() {
    $(this).addClass('active').siblings().removeClass('active');
});

and use active css instead of working with 2 elems. preview here: http://jsfiddle.net/acrashik/pfaUZ/9/

Sergei Zahharenko
  • 1,514
  • 12
  • 16
0

In your .pop class simply set the width to 100, it solves the issue:

.pop {
    display: none;
    position: absolute;
    left: 0;
    top: 0;
    height: 100px;
    width: 100px; /* <-- this one */
    background: #333;
    z-index: 9999;
}
Asherah
  • 18,948
  • 5
  • 53
  • 72