Hide a navbar when the user starts to scroll the page using javascript
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
margin: 0;
background-color: orange;
font-family: Arial, Helvetica, sans-serif;
}
#navbar {
background-color: #333;
position: fixed;
top: 0;
width: 100%;
display:block;
transition: top 0.3s;
}
#navbar a {
float: left;
display: block;
color: red;
text-align: center;
padding: 15px;
text-decoration: none;
font-size: 17px;
}
#navbar a:hover {
background-color: green;
color: orange;
}
</style>
</head>
<body>
<div id="navbar">
<a href="#home">Home</a>
<a href="#news">News</a>
<a href="#news">About Us</a>
<a href="#news">Contact Us</a>
<a href="#news">Sitemap</a>
</div>
<div style="padding:15px 15px 2500px;font-size:30px;margin-top:30px;">
<p><b>This example demonstrates how to hide a navbar when the user starts to scroll the page.</b></p>
<p>Scroll down this frame to see the effect!</p>
<p>Scroll up to show the navbar.</p>
</div>
<script>
var prevScrollpos = window.pageYOffset;
window.onscroll = function() {
var currentScrollPos = window.pageYOffset;
if (prevScrollpos > currentScrollPos) {
document.getElementById("navbar").style.top = "0";
} else {
document.getElementById("navbar").style.top = "-50px";
}
prevScrollpos = currentScrollPos;
}
</script>
</body>
</html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
margin: 0;
background-color: orange;
font-family: Arial, Helvetica, sans-serif;
}
#navbar {
background-color: #333;
position: fixed;
top: 0;
width: 100%;
display:block;
transition: top 0.3s;
}
#navbar a {
float: left;
display: block;
color: red;
text-align: center;
padding: 15px;
text-decoration: none;
font-size: 17px;
}
#navbar a:hover {
background-color: green;
color: orange;
}
</style>
</head>
<body>
<div id="navbar">
<a href="#home">Home</a>
<a href="#news">News</a>
<a href="#news">About Us</a>
<a href="#news">Contact Us</a>
<a href="#news">Sitemap</a>
</div>
<div style="padding:15px 15px 2500px;font-size:30px;margin-top:30px;">
<p><b>This example demonstrates how to hide a navbar when the user starts to scroll the page.</b></p>
<p>Scroll down this frame to see the effect!</p>
<p>Scroll up to show the navbar.</p>
</div>
<script>
var prevScrollpos = window.pageYOffset;
window.onscroll = function() {
var currentScrollPos = window.pageYOffset;
if (prevScrollpos > currentScrollPos) {
document.getElementById("navbar").style.top = "0";
} else {
document.getElementById("navbar").style.top = "-50px";
}
prevScrollpos = currentScrollPos;
}
</script>
</body>
</html>
Result:
Thanks for picking out the time to discuss this, I feel great about it and love studying more on this topic. It is extremely helpful for me. Thanks for such a valuable help again. Kohls 30 off coupon code is valid on sitewide purchases but between specific dates every month.
ReplyDeleteDPBOSS, DPBOSS MATKA, DP MATKA, SATTA MATKA
ReplyDeleteDPBOSS - Visit India's most trusted SATTA MATKA sattamatka.life/ Website. Check live DPBOSS Matka Result, DPBOSS Kalyan Chart and Play DP BOSS Matka.
For More Information Visit:- https://sattamatka.life/
Dpboss
SATTA MATKA, KALYAN MATKA, INDIAN MATKA, sattamatka.life
ReplyDeleteSatta matka offer - satta matka, matka, kuber matka, kalyan matka tips, free matka world, sattanumber, dpboss, fix matka result, gali sattanumber.
For More Information Visit:- https://sattamatka.life/
Satta Matka
I carry on listening to the reports talk about getting free online grant applications so I have been looking around for the most excellent site to get one. Could you tell me please, where could i acquire some? working capital loan
ReplyDeleteIndia vs Srilanka
ReplyDeleteIndia vs Srilanka
Dưới đây giải đáp những thắc mắc mà nhiều người vẫn thường hay đặt ra trong cuộc sống.
ReplyDelete- Rắn thạch anh có độc không?
- Rết có độc không?
- Thạch sùng có độc không?
ReplyDeleteNice blog. This blog is very informative.
please visit- India Vs Srilanka
Positive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work. trahaem.net/trahaem/2020/
ReplyDeleteMy brother suggested I might like this website. He was totally right. This post truly made my day. You cann't imagine simply how much time I had spent for this info! Thanks! Stainless Steel Tube
ReplyDeleteFantastic post!
ReplyDeleteA lot thanks for sharing with us,
We are again come on your website,
Thanks and good day,
Please visit our site,
Buy logo
Taxi Service in cuttack, Taxi in cuttack, Cabs Service in cuttack, A.C. Cabs Services in cuttack, Book Cab Online, Hire Cabs in cuttack, cuttack Cabs, Cheap Cabs Services in cuttack, Airport cabs Service in cuttack, Book Outstation Cabs in cuttack, cuttack to Outstation Cabs, Outstation Cabs in cuttack, One Way Cab Service in cuttack, Cabs & Taxi Service in cuttack, Taxi Fare in cuttack, cuttack Taxi Fare, Hire Taxi in cuttack, Local Taxi Services in cuttack, Online Taxi Booking cuttack, Airport Taxi New cuttack, Taxi Service cuttack, cuttack Taxi Service, Cheap Taxi Service in cuttack, Affordable Taxi Fares in cuttack, Cheap cuttack Taxi Service, Innova Cabs in cuttack, Innova Crysta Taxi for Local Outstation in cuttack, Innova Taxi for Outstation, Innova Taxi in cuttack, Toyota Innova Car for Local Ride, Toyota Innova Crysta Hire in cuttack
ReplyDeleteTaxi Service in bhubaneswar, Taxi in bhubaneswar, Cabs Service in bhubaneswar, A.C. Cabs Services in bhubaneswar, Book Cab Online, Hire Cabs in bhubaneswar, bhubaneswar Cabs, Cheap Cabs Services in bhubaneswar, Airport cabs Service in bhubaneswar, Book Outstation Cabs in bhubaneswar, bhubaneswar to Outstation Cabs, Outstation Cabs in bhubaneswar, One Way Cab Service in bhubaneswar, Cabs & Taxi Service in bhubaneswar, Taxi Fare in bhubaneswar, bhubaneswar Taxi Fare, Hire Taxi in bhubaneswar, Local Taxi Services in bhubaneswar, Online Taxi Booking bhubaneswar, Airport Taxi New bhubaneswar, Taxi Service bhubaneswar, bhubaneswar Taxi Service, Cheap Taxi Service in bhubaneswar, Affordable Taxi Fares in bhubaneswar, Cheap bhubaneswar Taxi Service, Innova Cabs in bhubaneswar, Innova Crysta Taxi for Local Outstation in bhubaneswar, Innova Taxi for Outstation, Innova Taxi in bhubaneswar, Toyota Innova Car for Local Ride, Toyota Innova Crysta Hire in bhubaneswar
ReplyDeleteTaxi Service in kanyakumari, Taxi in kanyakumari, Cabs Service in kanyakumari, A.C. Cabs Services in kanyakumari, Book Cab Online, Hire Cabs in kanyakumari, kanyakumari Cabs, Cheap Cabs Services in kanyakumari, Airport cabs Service in kanyakumari, Book Outstation Cabs in kanyakumari, kanyakumari to Outstation Cabs, Outstation Cabs in kanyakumari, One Way Cab Service in kanyakumari, Cabs & Taxi Service in kanyakumari, Taxi Fare in kanyakumari, kanyakumari Taxi Fare, Hire Taxi in kanyakumari, Local Taxi Services in kanyakumari, Online Taxi Booking kanyakumari, Airport Taxi New kanyakumari, Taxi Service kanyakumari, kanyakumari Taxi Service, Cheap Taxi Service in kanyakumari, Affordable Taxi Fares in kanyakumari, Cheap kanyakumari Taxi Service, Innova Cabs in kanyakumari, Innova Crysta Taxi for Local Outstation in kanyakumari, Innova Taxi for Outstation, Innova Taxi in kanyakumari, Toyota Innova Car for Local Ride, Toyota Innova Crysta Hire in kanyakumari
ReplyDeleteTaxi Service in madurai, Taxi in madurai, Cabs Service in madurai, A.C. Cabs Services in madurai, Book Cab Online, Hire Cabs in madurai, madurai Cabs, Cheap Cabs Services in madurai, Airport cabs Service in madurai, Book Outstation Cabs in madurai, madurai to Outstation Cabs, Outstation Cabs in madurai, One Way Cab Service in madurai, Cabs & Taxi Service in madurai, Taxi Fare in madurai, madurai Taxi Fare, Hire Taxi in madurai, Local Taxi Services in madurai, Online Taxi Booking madurai, Airport Taxi New madurai, Taxi Service madurai, madurai Taxi Service, Cheap Taxi Service in madurai, Affordable Taxi Fares in madurai, Cheap madurai Taxi Service, Innova Cabs in madurai, Innova Crysta Taxi for Local Outstation in madurai, Innova Taxi for Outstation, Innova Taxi in madurai, Toyota Innova Car for Local Ride, Toyota Innova Crysta Hire in madurai
ReplyDeleteTaxi Service in pondicherry, Taxi in pondicherry, Cabs Service in pondicherry, A.C. Cabs Services in pondicherry, Book Cab Online, Hire Cabs in pondicherry, pondicherry Cabs, Cheap Cabs Services in pondicherry, Airport cabs Service in pondicherry, Book Outstation Cabs in pondicherry, pondicherry to Outstation Cabs, Outstation Cabs in pondicherry, One Way Cab Service in pondicherry, Cabs & Taxi Service in pondicherry, Taxi Fare in pondicherry, pondicherry Taxi Fare, Hire Taxi in pondicherry, Local Taxi Services in pondicherry, Online Taxi Booking pondicherry, Airport Taxi New pondicherry, Taxi Service pondicherry, pondicherry Taxi Service, Cheap Taxi Service in pondicherry, Affordable Taxi Fares in pondicherry, Cheap pondicherry Taxi Service, Innova Cabs in pondicherry, Innova Crysta Taxi for Local Outstation in pondicherry, Innova Taxi for Outstation, Innova Taxi in pondicherry, Toyota Innova Car for Local Ride, Toyota Innova Crysta Hire in pondicherry
ReplyDeleteTaxi Service in mangalore, Taxi in mangalore, Cabs Service in mangalore, A.C. Cabs Services in mangalore, Book Cab Online, Hire Cabs in mangalore, mangalore Cabs, Cheap Cabs Services in mangalore, Airport cabs Service in mangalore, Book Outstation Cabs in mangalore, mangalore to Outstation Cabs, Outstation Cabs in mangalore, One Way Cab Service in mangalore, Cabs & Taxi Service in mangalore, Taxi Fare in mangalore, mangalore Taxi Fare, Hire Taxi in mangalore, Local Taxi Services in mangalore, Online Taxi Booking mangalore, Airport Taxi New mangalore, Taxi Service mangalore, mangalore Taxi Service, Cheap Taxi Service in mangalore, Affordable Taxi Fares in mangalore, Cheap mangalore Taxi Service, Innova Cabs in mangalore, Innova Crysta Taxi for Local Outstation in mangalore, Innova Taxi for Outstation, Innova Taxi in mangalore, Toyota Innova Car for Local Ride, Toyota Innova Crysta Hire in mangalore
ReplyDeleteI truly like this post!
ReplyDeleteA lot thanks for sharing with us,
We are again come on your website,
Thanks and good day,
Please visit our site,
Buy logo
hi...Top Tutor Bay is one of the most experienced and reliable writing assistance for students in writing essays, research papers, assignments, term papers, and dissertations, PowerPoint presentations, etc.please visit College Essay in UK, USA, Australia
ReplyDeleteEyal Nachum - Eyal Nachum is a fintech guru and a director at Bruc Bond. Eyal is the architect of the software that SMEs use to do cross-border payments. Eyal Nachum
ReplyDeleteThank you, I appreciate that I getting a lot of good and reliable information from your post. Thanks for sharing such kind of nice and wonderful post.
ReplyDeletePhp Web Development Company Bangalore | Website Developer Bangalore | Magento Website Developer Bangalore | Magento Service Provider India
New generation cycles from road races to off road adventures we got it all. Just checkout our new collection of Cyclux, Mountain bikes and geared cycles.
ReplyDeleteCyclux
Geared Bicycle
Moutain Bike
https://groups.google.com/d/topic/soc.history.medieval/2FuHpI5MtdQ
ReplyDeletehttps://groups.google.com/d/topic/soc.culture.nordic/LdAB0oaIHgA
https://groups.google.com/d/topic/soc.culture.usa/ER6FYQ5P2jk
https://groups.google.com/d/topic/soc.culture.australian/Hfnfrcr46HE
Due to COVID-19,Many businesses lost their revenue. But Our Digital Marketing Company USA Grow your business in less time. services we provide are design,development,online marketing,business,Web hosting and much more.
ReplyDeleteSports bicycles by Avon Cycles are oriented towards riders multi surface versatility, aggressive style and comfortable riding position. Avon Cycles got a wind range og sports, adventure and best high end cycles in India.
ReplyDeletebest sports cycles
Top high end cycls
best adventure cycle
sports cycle with gear
sports cycle online
avon sports bike
best high end bike
Yatharth is a super speciality hospitals in Noida (Delhi NCR) . The hospital has made its name as a best hospital in top ten hospitals in delhi within short period of time. It provides high-class facilities and medical treatment for its patients.
ReplyDeletesuper speciality hospital in delhi ncr
best hospital in delhi ncr
top hospitals in delhi ncr
among top ten hospital in delhi
among top private hospital in delhi
best hospital in in delhi ncr
delhi ncr super speciality hospital
among top 10 private hospitals in delhi
Yatharth Hospital in Noida(Delhi NCR) is a super speciality hospital. Yatharth Joint replacement and orthopedics is one of the best unit of what yatharth hospital provides facility.
ReplyDeletehospital near delhi ncr
orthopedic doctor in delhi ncr
best orthopedic doctor in delhi ncr
best orthopedic in delhi ncr
best knee replacement surgeon in ncr
best orthopaedic doctor in delhi ncr
If you like meeting, sitting and lying with sexy and beautiful girl, I am Alisha Roy, I will be your one stop destination. I am VIP Mumbai, 24 yrs old from Mumbai. Call me to get a date and enjoy with me as best as you can. I will be real buddy to give you the most memorable girlfriend experience. I have the capacity to entertain you in the best possible way irrespective of you are a dejected man, rejected lover, dissatisfied husband or an erotic love seeker. I am ready face any erotic encounter whether you are a simple sensual pleasure seeker or a modern man of supreme sexuality and promising promiscuity. You are sure to get the best Eros entertainment, as I am highly skilled in creative lovemaking and erotic pampering.
ReplyDeleteMumbai Escorts
Mumbai Escort
Mumbai Escorts Service
Mumbai Escorts Agency
Independent Mumbai Escorts
Escorts in Mumbai
Escorts Service in Mumbai
Independent Escorts in Mumbai
Mumbai Independent Escorts
Mumbai Call Girls
Call Girls in Mumbai
Escorts Agency in Mumbai
Mumbai Female Escorts
Mumbai Model Escorts
Escorts Mumbai
Russian Escorts in Mumbai
Russian Mumbai Escorts
Jaipur City has a lot of fun with relationship Alisha She, you can guide your efforts and effort accordingly, our services available 365 times, we have some other types of buddies, who provide you with the Independent Dating Service Offer Jaipur Town In, if you can like someone else by me, by the way you would have been relationship a lot of girls but going into relationship with me, you will have different views I will get it, because I am different from the models, especially in situation of loving endeavors, then come stress totally free and luxuriate in my youngsters, my youngsters will have an opportunity to perform only, so what is your fortune, So now, on my lifestyle, now you have the right to be your rightful owner for a while, will I be the king you've always dreamt of now, will you become a beggar of my lifestyle, so what about my devisors? If you are also in the list, then will you settle down my lifestyle, see what happens next, but it is so sure, that after knowing so much about me you will not be accepted, and soon you too will be my You will strategy to come nearer, because somewhere, your summer heat will get out of now a times, what is the here we are at you to pick up the device and make contact with me, I am waiting for get in touch with.
ReplyDeleteCall Girls in Jaipur | Call Girls in Visakhapatnam | Call Girls in Vijayawada | Call Girls in Aurangabad | Call Girls in Patna | Call Girls in Ajmer | Call Girls in Bikaner
Call Girls in Bhilwara | Call Girls in Barmer | Call Girls in Alwar | Call Girls in Kota | Call Girls in Jodhpur | Call Girls in Jaisalmer | Call Girls in Bikaner | Call Girls in Udaipur | Call Girls in Bhilai
ReplyDeleteCall Girls in Raipur | Call Girls in Surat | Call Girls in Vadodara | Call Girls in Rajkot | Call Girls in Daman | Call Girls in Diu | Call Girls in Allahabad | Call Girls in Greater Noida
ReplyDeleteCall Girls in Kanpur | Call Girls in Ghaziabad | Call Girls in Lucknow | Call Girls in Noida | Call Girls in Varanasi | Call Girls in Gurgaon | Call Girls in Jabalpur | Call Girls in Indore | Call Girls in Gwalior | Call Girls in Bhopal
ReplyDeleteCall Girls in Ratlam | Call Girls in Ujjain | Call Girls in Dehradun | Call Girls in Nainital | Call Girls in Haridwar | Call Girls in Mussoorie | Call Girls in Rishikesh | Call Girls in Aurangabad
ReplyDeleteCall Girls in Nagpur | Call Girls in Kolhapur | Call Girls in Nashik | Call Girls in Amritsar
ReplyDeleteCall Girls in Jalandhar | Call Girls in Ludhiana | Call Girls in Pathankot | Call Girls in Patiala
ReplyDeleteThis was an extremely wonderful post. Thanks for providing this info. Willy Wonka Jacket
ReplyDeleteThis was an extremely wonderful post. Thanks for providing this info.
ReplyDeletegeorge michael leather jacket
wow this great however ,I like your post and great pics might be any people dislike in light of the fact that defrent mind all poeple , best endocrinologist doctor in hyderabad
ReplyDeleteYou can take the McAlister’s Deli Survey to help them to make an improvement to their service and get a Free Coupon Code. talktomcalisters enter code
ReplyDeleteOur the purpose is to share the reviews about the latest Jackets,Coats and Vests also share the related Movies,Gaming, Casual,Faux Leather and Leather materials available Mayans MC Vest
ReplyDeleteHi there, You have performed an excellent job. I’ll certainly digg it and for my part recommend to my friends. I'm sure they will be benefited from this website.
ReplyDeletemba courses in singapore
Most of the high profile girls and house wives are in this profession. And lots of business man, politicians, and rich people prefer this service as well.
ReplyDeleteEscorts agency in Connaught Place
Escorts agency in Connaught Place
Escorts agency in noida
Pitampura Escorts
Kapashera Escorts
Ashram Escorts
Nice Blog !
ReplyDeleteHere We are Specialist in Manufacturing of Movies, Gaming, Casual, Faux Leather Jackets, Coats And Vests See Blade Runner 2049 Coat
I loved as much as you will receive carried out right here. The sketch is tasteful, your authored subject matter stylish. nonetheless, you command get bought an nervousness over that you wish be delivering the following. unwell unquestionably come more formerly again as exactly the same nearly very often inside case you shield this increase. hr services hong kong
ReplyDeletehrm software development company in chennai, crm software development company in chennai
ReplyDeleteThis article discusses the importance Buy Reddit accountsof this blog for business promotion. Promoting a blog is just like promoting any other website and can be difficult to do if you are not sure what needs to be done, but with the right tips and tricks, this doesn't have to be. Hopefully, you find this article on this blog helpful and decide to visit the site below to see just what they are talking about.
ReplyDeleteThanks for sharing this article. This has been really helpful.
ReplyDeleteBuy Custom Website
Great information about wilderness for beginners giving the opportunity for new people. Usmle Step 2
ReplyDeleteGreat article with a lot of useful tips.
ReplyDeleteprofessional web design services
Great Post! You definitely gave your insights.
ReplyDeleteBuy property online india
Great Post! You definitely gave your insights.
ReplyDeleteBuy property online india
Methadone is part of a category of drugs called opioids. German doctors created it during World War II.
ReplyDeleteBuy Methadone online
Xanax is a medicine used to treat anxiety, panic disorders and depression induced anxiety. It is known to produce a calming effect on the brain and the nerves by normalizing the imbalance in certain nerves.
ReplyDeleteBuy Xanax Online
Order your medicines without prescription, overnight delivery via FedEx at a discounted price in the United States. Top-quality Medicines
ReplyDeleteBuy Xanax Online
Opana is also known as oxymorphone is an opioid used for around-the-clock treatment of patients suffering from mild to severe pain.
ReplyDeleteBuy-Opana-online
Buy Generic medicines Online without prescription. Licensed Online Healthcare. ONLY HERE The Best QUALITY and LOW PRICES! High Quality Medications!
ReplyDeleteBuy Methadone Online
I am glad after visited this site. It contains useful information for the visitors. Thank you! We can help resolve all the issues befalling AOL email. If you are using AOL email service not being able to perform AOL sign in properly, then you need to ontact us today! AOL sign in
ReplyDeleteFelix Hospital is a best gynecology hospital in Noida, which provide best patient cares. It is a good hospital in Noida for obstetric diseases.
ReplyDeleteBest Gyneology Hospital in Noida
I'm truly grateful to you for offering Such sort of instructive articles to us.
ReplyDeleteReally helpful.
buy logo