prettyPhoto

by alekob77

HTML

<script src="http://www.spreadsheet123.com/js/pps.js"></script>
<header>
    <div class="container">
        <div class="container_in"> <a href="http://www.spreadsheet123.com/" title="Home: Spreadsheet123 Excel Templates, Calendars, and Calculators"><img src="http://cdn.spreadsheet123.com/images/spreadsheet123_logo.png" alt="Spreadsheet123 - The Ultimate Guide to The World of Excel" width="325" height="75" /></a>

            <div id="search"></div>
        </div>
    </div>
</header>
<nav>
    <div class="container">
        <div class="container_in">
            <div class="menu_logo"></div>
            <div id="menu-bar"></div>
            <div id="search_in_bar"></div>
            <div id="menu">
                <div><a class="tab" href="http://www.spreadsheet123.com/trial/index.html" title="Home">Home</a>
                </div>
                <div><a class="tab selected" href="http://www.spreadsheet123.com/trial/ExcelTemplates/index.html" title="Excel Templates">Excel Templates</a>
                </div>
                <div><a class="tab" href="http://www.spreadsheet123.com/trial/wordtemplates/index.html" title="Word Templates">Word Templates</a>
                </div>
                <div><a class="tab" href="http://www.spreadsheet123.com/trial/calculators/index.html" title="Calculators">Calculators</a>
                </div>
                <div><a class="tab" href="http://www.spreadsheet123.com/trial/calendars/index.html" title="Calendars">Calendars</a>
                </div>
                <div><a class="tab" href="http://www.spreadsheet123.com/trial/apps/index.html" title="Apps">Apps</a>
                </div>
                <div class="last"><a class="tab" href="http://www.spreadsheet123.com/trial/blog/index.html" title="Blog">Blog</a>
                </div>
            </div>
        </div>
    </div>
</nav>
<a href="http://cdn.spreadsheet123.com/images/ExcelTemplates/family-budget-planner_lg.png" rel="prettyPhoto" title="Family Budget...

CSS

body {
    height:2000px;
}
header {
    height:72px;
    padding:10px 0;
}
#search {
    float:right;
    margin-top:30px;
}
#search_in_bar {
    float:right;
    margin-top:10px;
}
#button {
    background-color:#06222e;
    color:#FFF;
    font-weight:bold;
    border-radius: 4px;
    -webkit-border-radius: 4px;
    -moz-border-radius: 4px;
    -o-border-radius: 4px;
    border:none;
    padding:3px;
}
#button:hover, #button:focus, #button:active {
    background:#069;
    cursor:pointer;
}
nav {
    clear:both;
    position:relative;
    margin-left: 0;
    height: 42px;
    background-color: rgb(104, 141, 170);
}
#menu div {
    float:left;
    border-right: 1px solid #729ab9;
}
#menu .tab {
    display:inline-block;
    padding: 3px 19px;
    line-height:36px;
    color: #fff;
    text-decoration:none;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
}
#menu a:hover, #menu a:focus, #menu a:active {
    background: rgba(25, 83, 123, .5);
}
#menu a.selected {
    background: rgba(6, 34, 46, .8);
}
#menu div.last {
    border-right:none;
}
nav.sticky #menu-bar {
    display: none;
    float: right;
    margin-left:25px;
}
nav.sticky #menu-bar-icon {
    background: url(http://cdn.spreadsheet123.com/images/menu-bar.png) no-repeat;
    width:50px;
    height:35px;
    display: block;
    margin-top:4px;
    cursor: pointer;
}
nav.sticky #menu-bar-icon:hover {
    background-position: 0 -36px;
}
nav.sticky #menu-bar-icon:active {
    background-position: 0 -72px;
}
nav.sticky #menu {
    display:none;
    background-color: rgba(104, 141, 170, .9);
    position:relative;
    clear:right;
    float:right;
    width:250px;
    margin-top:3px;
}
nav.sticky #menu div {
    float:none;
    border:none;
}
nav.sticky #menu .tab {
    display:block;
    font-size:15px;
    padding: 3px 12px;
    line-height:30px;
}
nav.sticky {
    position:fixed;
    top:0px;
    left:0px;
    right:0px;
    z-index:99999;
    height: 42px;
}
.menu_logo {
   ...

JavaScript

$(window).scroll(function () {
    if ($(window).scrollTop() > 90) {
        $("nav").addClass("sticky");
        $(".menu_logo").css("display", "block").html('<a href="http://www.spreadsheet123.com/" title="Home: Spreadsheet123 Excel Templates, Calendars, and Calculators"><img src="http://cdn.spreadsheet123.com/images/spreadsheet123_logo_sm.png" alt="Spreadsheet123 - The Ultimate Guide to The World of Excel" width="108" height="25" /></a>');
        $("#menu-bar").css("display", "block");
        $("#menu-bar").html('<div id="menu-bar-icon"></div>');
        $("#menu-bar-icon").click(function () {
            $('#menu').toggle();
            return false;
        });
        $("#menu").css("display", "none");
        $('#search_in_bar').html($('#search').html());
    } else {
        $("nav").removeClass("sticky");
        $(".menu_logo").css("display", "none");
        $("#menu").css("display", "block");
        $('#search_in_bar').html("");
        $("#menu-bar").css("display", "none");
    }
});