简体   繁体   中英

In IE 7 primefaces p:accordionPanel over laps p:menubar

In IE7 below code p:accordionPanel over laps p:menubar.ie., when i cick on menubar, menu items are hidden under p:accordionPanel . However there is no issue in Chrome and Firefox.

 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:p="http://primefaces.org/ui">
        <h:head>    
        </h:head>
        <h:body>
   <h:form>         
       <p:menubar>  
            <p:submenu label="Company" >
            <p:menuitem value="Software Engineer" />
            <p:menuitem value="Manager" />  
            <p:menuitem value="Business Ananlyst"  />
            <p:menuitem value="System Analyst" />
            </p:submenu>
    </p:menubar>

        <p:accordionPanel>
            <p:tab title="Lorem Ipsum ">
                <h:panelGrid columns="3">
                    <h:outputText
                        value="Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum"></h:outputText>
                </h:panelGrid>
            </p:tab>
        </p:accordionPanel>
    </h:form>
    </h:body>

</html>

It can solved by giving greater z-index to <p:menubar /> then <p:accordionPanel />

In my example changes i have done is

<p:menubar style="z-index:2000">
<p:accordionPanel style="z-index:1000">

However if there are multiple components it can be solved by using jquery. The component declared first will have z-index greater then later one

$(document).ready(function(){
 var zIndexNumber = 1000;
        $('div').each(function() {
            $(this).css('zIndex', zIndexNumber);
            zIndexNumber -= 10;
        });
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM