Pada artikel ini saya mau coba membahas bagaimanasih cara membuat menu statis. statis maksudnya yaitu ketika kita menscroll website tersebut kebagian bawah, maka menu pada web tersebut akan tetapi diam dibagian atas, sehingga memudahkan kita untuk memilih navigasi menu yang lainnya, intinya tidak usah repot mengscroll web tersebut kembali pada bagian atas dimana disitu baru kita bisa memilih menu navigasi yang lainnya. menu statis juga bisa dibilang yaitu sticky menu atau sticky menu bar.
<!doctype html>
<html>
<head>
<title>Menu Statis dengan Sticky Plugin</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="jquery.sticky.js"></script> <!-- file sticky jquery -->
<script>
$(window).load(function(){
$("#header").sticky({ topSpacing: 0 });
});
</script>
<style>
body {
height: 10000px;
padding: 0;
margin: 0;
}
#header {
background: #000000;
color: white;
font-family: Droid Sans;
font-size: 18px;
line-height: 1.6em;
font-weight: bold;
text-align: center;
padding: 10px;
text-shadow: 0 1px 1px rgba(0,0,0,.2);
width:100%;
box-sizing:border-box;
}
</style>
</head>
<body>
<p><center>Header</center></p>
<div id="header">
<p>Menu Statis dengan Jquery Sticky</p>
</div>
<p><center style='width:500px; height:500px; background:#333333; margin:auto; text-align:center; color:#fff'>Body </center></p>
</body>
</html>
Silahkan coba buat file html baru lalu copykan script diatas, maka hasilnya akan nampak seperti yang telah saya buat, jika tidak berjalan, mungkin kalian lupa menginclude file jquerynya yang telah saya jelaskan sebelumnya.
Sekian pembahasan artikel kali ini, jika ada yang kurang jelas dan tidak paham bisa menanyakannya dikolom komentar. semoga artikel ini membantu teman-teman semua. Terima kasih telah berkunjung di blog ini, jangan lupa baca artikel menarik yang lainnya.
Thank you for taking the time to provide us with your valuable information. We strive to provide our candidates with excellent care.As always, we appreciate your confidence and trust in us…!!! SAP Training in Chennai
All are saying the same thing repeatedly, but in your blog I had a chance to get some useful and unique information, I love your writing style very much, I would like to suggest your blog in my dude circle, so keep on updates.
SAP training in Chennai
Superb explanation & it's too clear to understand the concept as well, keep sharing admin with some updated information with right examples.Keep update more posts.
Digital Marketing For Small Business in Chennai
Great information shared in this blog. Helps in gaining concepts about new information and concepts.Awsome information provided.Very useful for the beginners.
SEO Training in Chennai
Great information shared in this blog. Helps in gaining concepts about new information and concepts.Awsome information provided.Very useful for the beginners.
sqlserver training in chennai
What you have written in this post is exactly what I have experience when I first started my blog.I’m happy that I came across with your site this article is on point,thanks again and have a great day.Keep update more information.
Laser Root Canal Treatment In Chennai
This idea is mind blowing. I think everyone should know such information like you have described on this post. Thank you for sharing this explanation.Your final conclusion was good. We are sowing seeds and need to be patiently wait till it blossoms.
Hadoop Training in Chennai
Base SAS Training in Chennai