Top-bottom navigation button

Developer
Size
2,514 Kb
Views
10,120

How do I make an top-bottom navigation button?

What is a top-bottom navigation button? How do you make a top-bottom navigation button? This script and codes were developed by Reinis on 06 December 2022, Tuesday.

Top-bottom navigation button Previews

Top-bottom navigation button - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>top-bottom navigation button</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div id="blue"></div>
<div id="red"></div> <a href="#red" onclick="toggleVisibility('footerbuttonup');"><div id="footerbuttondown" class="content"></div></a> <a href="#blue" onclick="toggleVisibility('footerbuttondown');"><div id="footerbuttonup" class="content"></div></a>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script>
$(document).ready(function(){ // Add smooth scrolling to all links $("a").on('click', function(event) { // Make sure this.hash has a value before overriding default behavior if (this.hash !== "") { // Prevent default anchor click behavior event.preventDefault(); // Store hash var hash = this.hash; // Using jQuery's animate() method to add smooth page scroll // The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area $('html, body').animate({ scrollTop: $(hash).offset().top }, 800, function(){ // Add hash (#) to URL when done scrolling (default click behavior) window.location.hash = hash; }); } // End if });
});
</script> <script src="js/index.js"></script>
</body>
</html>

Top-bottom navigation button - Script Codes CSS Codes

body {margin:0px;}
#blue { height:80vh; background-color:blue;
}
#red { height:80vh; background-color:red;
}
#footerbuttondown { bottom: 10px; right: 10px; height: 50px; width:50px; margin: 0; position: fixed; z-index: 999; background-image: url("http://cdn.mysitemyway.com/icons-watermarks/simple-black/raphael/raphael_arrow-down-circle/raphael_arrow-down-circle_simple-black_512x512.png"); background-repeat: no-repeat; background-size: 100% 100%; background-position: center; background-color: rgba(0, 200, 0, 1);
}
#footerbuttondown:hover { background-image: url("http://cdn.mysitemyway.com/icons-watermarks/simple-black/raphael/raphael_arrow-down-circle/raphael_arrow-down-circle_simple-black_512x512.png");
}
#footerbuttonup { bottom: 10px; right: 10px; height: 50px; width:50px; margin: 0; position: fixed; z-index: 999; display: none; background-image: url("http://pngplay.com/wp-content/uploads/2016/07/Up-Arrow-PNG-14-220x220.png"); background-repeat: no-repeat; background-size: 100% 100%; background-position: center; background-color: rgba(0, 200, 0, 1);
}
#footerbuttonup:hover { background-image: url("http://pngplay.com/wp-content/uploads/2016/07/Up-Arrow-PNG-14-220x220.png");
}

Top-bottom navigation button - Script Codes JS Codes

 function toggleVisibility(selectedTab) { var content = document.getElementsByClassName('content'); for(var i=0; i<content.length; i++) { if(content[i].id == selectedTab) { content[i].style.display = 'block'; } else { content[i].style.display = 'none'; } } }
Top-bottom navigation button - Script Codes
Top-bottom navigation button - Script Codes
Home Page Home
Developer Reinis
Username 72
Uploaded December 06, 2022
Rating 3
Size 2,514 Kb
Views 10,120
Do you need developer help for Top-bottom navigation button?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Reinis (72) Script Codes
Create amazing sales emails with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!