http://kachibito.net/snippets/access-fast-link-on-fixed-bottom-page
上記のサイトを参考にしてフッターを表示/非表示できるHTMLを作成しようとしています。
そのままコピーしたはずなのですが・・・ボタン「>>」が表示されず困っております。
対象のブラウザはSafari10.0.1にて検証しています。
何かご教授いただければ幸いです。
----------HTML----------
<!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <title>jQueryの練習</title> <link href="css/sample.css" rel="stylesheet"> </head> <body> <div class="footer"> <div class="button">»</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> <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script> <script> $(document).ready(function() {for(i=1;i<=80;i++) $('body').append('<p>text '+i+': sample text</p>');
/Here's the code/
$('.button').toggle(function(){
$(this).html('«');
$('.content').slideUp(300);
}, function(){
$(this).html('»');
$('.content').slideDown(300);
});
});
</script>
----------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:50px;
text-align:center;
padding:10px;
background:#333;
color:#eee;
font-weight:bold;
cursor:pointer;
}
.footer .button:hover{
background:#eee;
color:#666;
}
.footer .content{
text-align:center;
background:#666;
padding:10px;
}
.footer .content a{
color:#FFF;
margin:0 5px 0 5px;
}
回答3件
あなたの回答
tips
プレビュー