Labels

php (35) javascript (31) phpjavascript (30) jquery (23) html (20) mysql (14) database (9) codeigniter (4) json (4) bar chart (2) calendar (2) column chart (2) framework (2) google maps (2) query (2) tables (2) url (2) dropdown (1)

Sunday, July 8, 2018

Hide navbar when user starts to scroll the page down using javascript

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>

Result:



93 comments:

  1. Supertech E Square is a great mix of commercial, retail and entertainment offering well place by Supertech Limited at Sector 96, Noida.

    ReplyDelete
  2. ‘Sodom’ in the Garden City: Coded Port Harcourt hangout where rich, horny women hire men for s3x discovered
    ‘Sodom’ in the Garden City: Coded Port Harcourt hangout where rich, horny women hire men for s3x discovered

    A coded joint in Port Harcourt, the Rivers state capital where men and women go to hire men to give them good quality s3x has been discovered.

    The name Port Harcourt represents many things to diverse individuals.


    Read More @ Horny Women hire men for s3x discovered

    ReplyDelete
  3. As students’ college loan debt grows, How much student loan debt is too much?

    With more students attending college, and taking on debt to do it, the nation’s outstanding student loan debt grew by 2.1 percent, to $1.41 trillion, from $1.38 trillion at year-end 2017, according to the Federal Reserve Bank of New York.
    Loans can have some unexpected benefits Read More @

    How much student loan debt is too much?

    ReplyDelete
  4. Your attention to detailed information puts you at the top.
    You are an inspiration to us.
    Web Designing company in kolkata
    psd template/game download/blogs

    ReplyDelete
  5. Hi, So much Thanks for the share. It was very helpful to us. Very informative post.

    ReplyDelete
  6. I Am So Happy To Read This. This Is The Kind Of Manual That Needs To Be Given And Not The Random Misinformation That's At The Other Blogs.

    ReplyDelete
  7. Nice post.
    If you are roadrunner email user and want your Roadrunner Email Password Reset then call roadrunner email helpline +1-888-338-6033.

    ReplyDelete
  8. A debt of gratitude is in order for composing a brilliant article and I got extremely intriguing by understanding It has the most enlightening well ordered directions I have read.If you have any inquiry with Norton then you call our number+18555583999.

    ReplyDelete
  9. pls i want to learn php, jave scrip, and bootstrap factworld.com.ng

    ReplyDelete
  10. This comment has been removed by the author.

    ReplyDelete
  11. Really helpful post to hide navigation bar for android application development ...thanks for sharing that kind of codes.
    mobile application development company in UK

    ReplyDelete
  12. This comment has been removed by the author.

    ReplyDelete
  13. The online courses offered provide sufficient detail about marketing as well as provide complete detail to measure the program properly with the help of browsers and customers that are eventually provided to the student to enhance their level of knowledge.

    marketing agencies in singapore

    ReplyDelete
  14. Social media marketing allows your customers to get to know your interests in ways they never would otherwise. It humanizes you and highlights the commonalities shared with others. People want to buy merchandise and do business with people like them in their neighborhoods.

    marketing courses in singapore

    ReplyDelete
  15. Your article is easy to understand, simple communication is accessible to most people. I will keep track of your posts regularly
    hotmail login

    ReplyDelete
  16. Hi, i read your blog from time to time and i own a similar one and i was just wondering if you get a lot of spam comments? If so how do you protect against it, any plugin or anything you can advise? I get so much lately it's driving me crazy so any help is very much appreciated.kundli matching

    ReplyDelete
  17. I am really enjoying reading your well written articles. It looks like you spend a lot of effort and time on your blog. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work.

    ReplyDelete
  18. People want to buy merchandise and do business with people like them in their neighborhoods. Airtel bondho sim offer

    ReplyDelete
  19. nice article thanks for shearing

    ReplyDelete
  20. This comment has been removed by the author.

    ReplyDelete
  21. A well written perspective! Thanks for sharing this useful info.
    Website Designing Company Meerut

    ReplyDelete
  22. This is really impressible post for everyone to know about this matter. I am so glad to read this. Thank you so much for sharing your helpful experience.

    If you want know more please visitFashion



    ReplyDelete

  23. Its really feeling great as our hard work is helping someone. Thanks for visiting our blog.
    More effective blog

    ReplyDelete
  24. The effectiveness of marketing tools will also have to be monitored to ensure that the approach continues to be fruitful. There are a number of site optimization and email marketing tools that are available today. Careful analysis and selection of internet marketing strategies will help ensure business success.

    seo company singapore

    ReplyDelete
  25. Nice Article for freelancers. Thanks for writing such a good article in the form of tips for freelancing jobs.

    ReplyDelete
  26. This is a very impressive post thanks dear! do you want dofollow backlink from my website? just comment on my post related! Wafi Apps

    ReplyDelete
  27. This is important as who can really tell from lying on it in a store if it will be right for you for a whole night. My friends thought they wanted a firm mattress but are miserable on it and didn't buy from a store that would let them return it.

    Joe Davies

    ReplyDelete
  28. nice blog! it's interesting. thank you for sharing.

    womens denim shirt

    ReplyDelete
  29. I have always admired your site, Thanks for the great tips and work .
    Web Design and Development Oman

    ReplyDelete
  30. Slides taken today maybe have the best chance of being viewable in 100 years as all you need to do is hold it up to the light.

    seo agency singapore

    ReplyDelete
  31. Hello,
    I really appreciate this wonderful post that you have provided for us. I assure this would be beneficial for most of the people.
    Digital Marketing Agency in India

    ReplyDelete
  32. Hello, I have read your post and it is good to me.
    I have a site you can follow it https://www.grandgatewayhotel.com/

    ReplyDelete
  33. Hello, I have read your post and it is good to me.
    I have a site you can follow it https://www.grandgatewayhotel.com/

    ReplyDelete
  34. Hello, I have read your post and it is good to me.
    I have a site you can follow it https://www.grandgatewayhotel.com/

    ReplyDelete
  35. Thanks for sharing this interesting and informative post. This blog is very helpful for me.

    register a private company in india

    ReplyDelete
  36. Hello , I have already visit your post . It’s really good for me . I have a site you can follow this http://www.hotels4humanity.com
    Thank you.

    ReplyDelete
  37. Your selection of topic is very good and also well written. Thanks for sharing. I feel like all your ideas are incredible! Great job!!!
    http://www.prestigelakeridgebangalore.co.in/
    http://www.mantriserenitykanakapuraroad.in/
    http://www.prestigefalconcitykanakapuraroad.in/
    http://www.godrejairhoodi.co/
    http://www.goyalorchidwhitefield.net/
    http://www.prestigewillowtree.co/

    ReplyDelete
  38. Great post! Thanks for sharing this amazing post. visit: Gujarati News

    ReplyDelete
  39. Shophoop is an online site that offers products like Printer & Scanner and many other devices for purchase to the customers at really reasonable prices. There are products like all types of printers, desktops and their peripheral devices, Computers & Tablets headphones, speakers, printers, laptops, cameras, tablets, computer accessories, computer components, chromebooks etc. Customers can buy from about 1.5 million products on Shophoop. Displayed products on Shophoop has been categorized into various groups on the basis of different criteria that makes selection of desired product for the customers much easier.
    Computers & Tablets
    Printer & Scanner
    Bags & Carry cases

    ReplyDelete
  40. article has been written in a beautiful way great job php-javascript

    ReplyDelete
  41. BuyKamagra Online is used for Enlarged prostate gland in male, Increased blood pressure in lungs and other conditions. Know about the uses, side effects, price, composition, substitutes, How it works, Lowest Price Online. Kamagra Gold 100mg Online buy with lowest Price Ever Online Pharmacy. Kamagra Gold 100mg Reviews.

    ReplyDelete
  42. Buy Super Vidalista Online is used for Enlarged prostate gland in male, Increased blood pressure in lungs and other conditions. Know about the uses, side effects, price, composition, substitutes, How it works, Lowest Price Online. Super Vidalista Online buy with lowest Price Ever Online Pharmacy. Super Vidalista Reviews.

    ReplyDelete
  43. related services https://www.entof.com/watch?v=-3LGsHOSTec&t=1s

    ReplyDelete
  44. Great website this post gave me all useful information which I wanted to know I liked the collection and the way you described it. I value this post.
    Online Dresses Shopping UAE

    ReplyDelete
  45. Thank you very much for for your great information. It really makes me happy and I am satisfied with the arrangement of your post. You are really a talented person I have ever seen. I will keep following you forever. If you have time you can check this site and give me suggestion. click->
    Hotel Bedding Supplies

    ReplyDelete
  46. This comment has been removed by the author.

    ReplyDelete
  47. Great article. It was fun working on the project. Thanks to you for sharing the idea. I now know a thing or two more than I did before this. I am looking forward to adding more features to it soon. please visit our site. Packaging Company

    ReplyDelete
  48. Hello , I have already visit your post. Thank you very much for for your great information. It really makes me happy and I am satisfied with the arrangement of your post. You are really a talented person I have ever seen. I will keep following you forever. I have a site. If you have time,so you can visit this site and give me suggestion. Please click-> https://www.eagleg.com/

    ReplyDelete
  49. Hello , I have already visit your post. Thank you very much for for your great information. It really makes me happy and I am satisfied with the arrangement of your post. You are really a talented person I have ever seen. I will keep following you forever. I have a site. If you have time,so you can visit this site and give me suggestion. Please click-> https://www.eagleg.com/

    ReplyDelete
  50. Great article. It was fun working on the project. Thanks to you for sharing the idea.I am sharing some important topic now you can you easily get free Roblox Asset Downloader. For more information visit my blog Rassetdownloader

    ReplyDelete
  51. ethereumpro.net is best website to exchange ethereum to paypal.visit us for instant convert ethereum to paypal and other
    https://www.ethereumpro.net/

    ReplyDelete
  52. One of the world's top rate website with 5 stars feed back with 100% trust flow,
    Most amazing source link for cryptocurrency conversion

    Ethereum to Paypal Fast Exchange

    thanks for visiting our link

    ReplyDelete
  53. Great website this post gave me all useful information which I wanted to know I liked the collection and the way you described it. I value this post.
    Online Dresses Shopping UAE

    ReplyDelete
  54. This is a great post. I check your blogs regularly but after reading this blog and I’m inspired. It is extremely helpful information 🙂 I read such information a lot, for my personal knowledge.
    Thank you for sharing this useful information, I will regularly follow your blog. Excellent post, thanks for sharing, it’s indeed very helpful for a new blogger like me. I am sharing some important topic now you can you easily get free Roblox Asset Downloader. For more information visit my blog Rassetdownloader

    ReplyDelete

  55. BusinessArcade.com | UAE The Hotspot to Buy Online in Dubai UAE with wholesale price for Women Dresses, Shoes, Lingerie, Shirt, Jewellery and Watches. The One Stop Online Shopping Mall. Casual dresses for women Dubai Business Arcade Provide best quality causal dresses and party dresses in Dubai with new design and free home delivery

    ReplyDelete
  56. good article
    from https://www.flexistamps.com/

    ReplyDelete
  57. This comment has been removed by the author.

    ReplyDelete
  58. I love your blog.. very nice colors & theme. Did you design this website yourself or did you hire someone to do it for you? Plz reply as I'm looking to design my own blog and would like to find out where u got this from. thanks a lot
    Web development company in Chennai

    ReplyDelete
  59. Once again feeling happy and proud to say that this is my favorite Blog. The postings are very unique and also outstanding performance with the new creativity and Excellency with the new different ideas and concepts. Really I am waiting for some more new posts from you. Keep up your Excellency and efficiency in these same levels. Please visit our site. Packaging Company

    ReplyDelete
  60. Once again feeling happy and proud to say that this is my favorite Blog. The postings are very unique and also outstanding performance with the new creativity and Excellency with the new different ideas and concepts. Really I am waiting for some more new posts from you. Keep up your Excellency and efficiency in these same levels. Please visit our site. Packaging Company

    ReplyDelete
  61. Great post! Do you have any helpful hints for aspiring writers? I'm planning to start my own website soon but I'm a little lost on everything. Would you suggest starting with a free platform like Wordpress or go for a paid option? There are so many options out there that I'm totally confused .. Any tips? Appreciate it! cheap web design services

    ReplyDelete
  62. Ethereumpro.net provides the cheapest way to exchange ethereum to paypal usd where anyone can withdraw and transfer crypto ether coins to paypal without a minimum amount required. The system works automatically with high speed. Visit
    https://www.ethereumpro.net/exchange-ethereum-to-paypal.php

    ReplyDelete
  63. Greetings from Florida! I'm bored at work so I decided to browse your site on my iphone during lunch break. I enjoy the information you present here and can't wait to take a look when I get home. I'm surprised at how quick your post loaded on my phone .. I'm not even using WIFI, just 3G .. Anyhow, good site! sem marketing

    ReplyDelete
  64. Hello there! Would you mind if I share your blog with my twitter group? There's a lot of people that I think would really appreciate your content. Please let me know. CheersMehndi Design

    ReplyDelete
  65. Entry-level employees commonly learn the profession by performing administrative duties—helping to enter data into computer systems, compiling employee Handbooks, researching information for a supervisor, or answering the phone and handling routine questions.

    funds

    ReplyDelete

  66. Great website this post gave me all useful information which I wanted to know I liked the collection and the way you described it. I value this post.
    Online Dresses Shopping UAE

    ReplyDelete
  67. It truly is definitely excellent post. I am really very pleased to check out your website. I am found that any of us actually want. Thank you so much.
    https://www.bharattaxi.com

    ReplyDelete

More Posts

FOLLOW