Return to Snippet

Revision: 45760
at May 7, 2011 00:16 by genik


Updated Code
/*Javascript********************************************************************************/
$(function(){
    /*Just sample data*/
    for(i=1;i<=50;i++) $('body').append('<h1>text '+i+': blah...blah...blah...</h1>');
    
    /*Here's the code*/		
    $('.button').toggle(function(){
        $(this).html('&#171;');
        $('.content').slideUp(300);
    }, function(){
        $(this).html('&#187;');
        $('.content').slideDown(300);
    });
});


/*CSS**************************************************************************************/
body{margin:0;padding:0;color:#CCC;}
	
.footer{
    position:fixed;
    z-index:100;
    width:100%;
    bottom:0px;
    border-top:#222 solid 1px;
}
	
.footer .button{
    position:fixed;
    right:0px;
    bottom:0px;
    width:10px;
    text-align:center;
    padding:5px;
    background:#333;
    color:#FFF;
    font-weight:bold;
    cursor:pointer;
}
	
.footer .button:hover{
    background:#F60;
}
	
.footer .content{
    text-align:center;
    background:#000;
    padding:5px;
}
	
.footer .content a{
    color:#FFF;
    margin:0 5px 0 5px;
}


/*HTML***********************************************************************************/
<div class="footer">
    <div class="button">&#187;</div>
    <div class="content">
        <a href="#">Menu 1</a>
        <a href="#">Menu 2</a>
        <a href="#">Menu 3</a>
        <a href="#">Menu 4</a>
        <a href="#">Menu 5</a>
    </div>
</div>

Revision: 45759
at May 7, 2011 00:14 by genik


Initial Code
/*Javascript********************************************************************************/
$(function(){
    /*Just sample data*/
    for(i=1;i<=50;i++) $('body').append('<h1>text '+i+': blah...blah...blah...</h1>');
    
    /*Here's the code*/		
    $('.button').toggle(function(){
        $(this).html('&#171;');
        $('.content').slideUp(300);
    }, function(){
        $(this).html('&#187;');
        $('.content').slideDown(300);
    });
});


/*CSS**************************************************************************************/
body{margin:0;padding:0;}
	
.footer{
    position:fixed;
    z-index:100;
    width:100%;
    bottom:0px;
    border-top:#222 solid 1px;
}
	
.footer .button{
    position:fixed;
    right:0px;
    bottom:0px;
    width:10px;
    text-align:center;
    padding:5px;
    background:#333;
    color:#FFF;
    font-weight:bold;
    cursor:pointer;
}
	
.footer .button:hover{
    background:#F60;
}
	
.footer .content{
    text-align:center;
    background:#000;
    padding:5px;
}
	
.footer .content a{
    color:#FFF;
    margin:0 5px 0 5px;
}


/*HTML***********************************************************************************/
<div class="footer">
    <div class="button">&#187;</div>
    <div class="content">
        <a href="#">Menu 1</a>
        <a href="#">Menu 2</a>
        <a href="#">Menu 3</a>
        <a href="#">Menu 4</a>
        <a href="#">Menu 5</a>
    </div>
</div>

Initial URL


Initial Description
Show link on bottom page.

Initial Title
Access Fast Link on Fixed Bottom Page

Initial Tags
link

Initial Language
jQuery