0

In by below code i am trying to check whether there are any Li that is visible. that well help me to determine whether to display some message or not.

but li:visible is not working in IE 7

function MangeEmptyRecordList() {
    var leftPanel = $('#' + firstContainer);
    var rightPanel = $('#' + secondContainer);
    var firstContainerList = leftPanel.find('li:visible');
    if (firstContainerList.length > 0) {
        $("#emptyFirstContainer").hide();
    }
    else {
        $("#emptyFirstContainer").show();
    }
}

what is the alternate of :visible for IE7.

PS: In some situation there are some Li that are invisible.

ankur
  • 3,890
  • 13
  • 52
  • 91

1 Answers1

0

Are you using the latest version of jQuery, 1.7.1?

Moreover, "visible" generally refers to visibility:hidden; or opacity:0; although it should refer ti display:none; as well. Where as hide() and show() generally refer to display:none; Although both should work, try the selector :hidden; instead to see if you have any luck.

Finally, another Stack Overflow discussion mentioned that :visible doesn't work in functions. Although it was written in 2008, hence it working in all other browsers, but could plausibly be the issue for IE7. There have been several other issues with that selector in the past, but I would assume they've been fixed. But again, hopefully :hidden will work.

If none of those work, there's several other ways to accomplish the same thing, but with much less elegance. Hopefully one of the above bears some fruit.

Community
  • 1
  • 1
David Hobs
  • 3,611
  • 2
  • 18
  • 20