1

我在我自己的个人网站上工作。如果您将鼠标悬停在任何导航栏元素上,您会注意到有一些闪烁,并且并非所有元素都可见。您可以通过 验证这一点F12。在我看来,<aside>标签“隐藏”了我正在寻找的信息。

有人可以告诉我如何将导航栏带到某物的前面。我不太确定这里发生了什么。

index.php

<!DOCTYPE HTML>
<html lang="en">
    <head>
        <meta charset="UTF-8"/>
        <title>Grown Kidd Creations</title>
        <link rel="stylesheet" href="css/main.css">
        <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
        <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>
        <script type="text/javascript">
            $(document).ready(function(){
            });
        </script>
    </head>
    <body>
        <header>
            <img alt="Picture of me and Cian" src="img/caindaddysleepin.jpeg" title="Cian and Daddy">
            <?include_once 'nav/nav.php';?>
        </header>
        <aside class="left"><p>No idea what to put here. how about you fill out the form and tell me?</p></aside>

        <aside class="right">
            Recent News/Updates:<br/>
            <span class="undercon">This will be updated soon with links and maybe a blog.</span>
            <ul>
                <li>Cian</li>
                <li>Work</li>
                <li>Family</li>
            </ul>
        </aside>
        <footer>
            Send me some love at <a href="mailto:billythakidd04@gmail.com">BillyThaKidd04@gmail.com</a><br/>
            Or find me at:<br/>
            <div class="g-plus" data-href="https://plus.google.com/109325835178774768962?prsrc=3" data-theme="dark" rel="author"></div>
            <a href="https://twitter.com/ThaKidd04" class="twitter-follow-button" data-show-count="false" data-size="large">Follow @ThaKidd04</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
        </footer>
    </body>
</html>

nav.php

<?//navigation bar?>
<script>
    var el = document.getElementsByTagName("body")[0];
    el.className = "";
</script>
<noscript>
<!--[if IE]>
    <link rel="stylesheet" href="nav/css/ie.css">
<![endif]-->
</noscript>
<link rel="stylesheet" href="nav/css/nav.css">
    <!--[if IE]>
        <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <nav id="topNav" class="no-js">
        <ul>
            <li><a href="index.php" title="Home">Home</a></li>
            <li><a href="#" title="Projects">Projects</a>
                <ul>
                    <li><a href="" title="Personal Projects">Personal Projects</a></li>
                    <li><a href="" title="Work Projects">Work Projects</a></li>
                    <li class="last"><a href="pages/sitepage.php" target="new" title="About this site">This Site</a></li>
                </ul>
            </li>
            <li><a href="contactme.php" title="Contact Me">Contact Me</a>
                <ul>
                    <li><a href="http://www.facebook.com/BillyThaKidd" target="new" title="FaceBook">FaceBook</a></li>
                    <li><a href="" target="new" title="Google Plus">Google +</a></li>
                    <li><a href="" target="new" title="LinkedIn">LinkedIn</a></li>
                    <li class="last"><a href="" title="Email Me">Email Me</a></li>
                </ul>
            </li>
            <li><a href="/pages/viewblog.php" title="About Me">About Me</a>
                <ul>
                    <li><a href="/pages/viewblog.php">Blog</a></li>
                    <li><a href="" title="Resume">Resume</a></li>
                    <li class="last"><a target="new" href="https://github.com/billythakidd04" title="GitHub">GitHub</a></li>
                </ul>
            </li>
        </ul>
    </nav>
    <script src="nav/js/modernizr.custom.69568.js"></script>
    <script>
        (function($)
        {
            //cache nav
            var nav = $("#topNav");

            //add indicators and hovers to submenu parents
            nav.find("li").each(function()
            {
                if ($(this).find("ul").length > 0)
                {
                    $("<span>").text("").appendTo($(this).children(":first"));

                    //show subnav on hover
                    $(this).mouseenter(function()
                    {
                        $(this).find("ul").stop(true, true).slideDown();
                    });

                    //hide submenus on exit
                    $(this).mouseleave(function()
                    {
                        $(this).find("ul").stop(true, true).slideUp();
                    });
                }
            });
        })(jQuery);
    </script>
4

1 回答 1

1

你应该发布你的css,因为似乎整个问题是相关的——或者至少可以通过z-index调整来解决:

z-index CSS 属性指定元素及其后代的 z 顺序。当元素重叠时,z-order 确定哪个元素覆盖另一个元素。z-index 较大的元素通常会覆盖 z-index 较小的元素。

于 2013-02-03T18:12:03.543 回答