membuat efek sidebar
pasti binggug kan denger judul nya
yah kalo anda belum tahu apa itu sidebar saya akan menjelaskan pertama nya dulu , sidebar setau saya adalah sebuah menu yang ada dipinggir atau tool yang disediakan di pinggir
fungsi sidebar adalah membuat tampilan sebuah web lebih dinamis dan lebih elegan
disini saya akan menjelaskan tentang cara membuat sidebar yang bagus cocok untuk yang anda mau buat web minimalis
oke le'ts get started
first/ pertama
kita siapkan dulu file html terserah mau di kasih nama apa dan juga siapkan background nya
setelah itu buka file htmlnya mengunakan notepad++
jika sudah dibuka seperti diatas silakan copy code dibawh ini
<head>
<title>nusakom</title>
<style type="text/css">
* { margin: 0; padding: 0; }
body { font: 15px/1.4 Georgia, serif background-image:"blue-smooth-wallpaper-20636-21503-hd-wallpapers.jpg"; }
#page-wrap { width: 600px; margin: 15px auto; }
p { margin: 0 0 15px 0; }
p:first-child { background: #fffcde; padding: 10px; }
#sidebar ul { background: #eee; padding: 10px; }
li { margin: 0 0 0 10px; }
#main { width: 390px; float: left; }
#sidebar { width: 190px; float: left; }
</style>
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js?ver=1.3.2'></script>
<script type="text/javascript">
$(function() {
var offset = $("#sidebar").offset();
var topPadding = 15;
$(window).scroll(function() {
if ($(window).scrollTop() > offset.top) {
$("#sidebar").stop().animate({
marginTop: $(window).scrollTop() - offset.top + topPadding
});
} else {
$("#sidebar").stop().animate({
marginTop: 0
});
};
});
});
</script>
</head>
<body>
<body background="bg.jpg">
<div id="sidebar">
<ul>
<li><a href="#">link ke 1</a></li>
<li><a href="#">link ke 2</a></li>
<li><a href="#">link ke 3</a></li>
<li><a href="#">link ke 4</a></li>
<li><a href="#">link ke 5</a></li>
<li><a href="#">link ke 6</a></li>
<li><a href="#">link ke 7</a></li>
<li><a href="#">link ke 8</a></li>
<li><a href="#">link ke 9</a></li>
</ul>
</div>
<div id="page-wrap">
<div id="title-area">
<h1>Scrolling Sidebar</h1>
<p>By <a href="http://css-tricks.com"><strong>CSS</strong>-Tricks</a></p>
</div>
<div id="main">
<p>scroll maka sidebar akan mengikuti</p>
<p> nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=
nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com
nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=
nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=
nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=
nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=
nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=</p>
<p> nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=
nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com
nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=
nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=
nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=
nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=
nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=</p>
<p> nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=
nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com
nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=
nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=
nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=
nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=
nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=</p>
<p> nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=
nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com
nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=
nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=
nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=
nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=
nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=</p>
<p> nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=
nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com
nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=
nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=
nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=
nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=
nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=nusa-kom.blogspot.com=</p>
</div>
</div>
</body>
</html>
copy code diatas dan pastekan di file html anda tadi dan setelah itu buka dengan browser file html tadi
dan hasilnya
penjelasannya dibawah
kalau ngak mau repot buat nya jadi download aja dibawah ini :
disini download html
disini download background
Tidak ada komentar:
Posting Komentar