Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8" />
- <link rel="stylesheet" href="css/style.css" />
- <script type="text/javascript">
- var n1, n2, n3, n4; // points to the navigation
- var d1, d2, d3, d4; // point to the div tags
- var highLight = "#ffde07";
- var normal = "#4c4d4e";
- function init () {
- // calls the navigation
- n1 = document.getElementById("nav1");
- n2 = document.getElementById("nav2");
- n3 = document.getElementById("nav3");
- n4 = document.getElementById("nav4");
- // calls the ids in divs
- d1 = document.getElementById("Home");
- d2 = document.getElementById("Budget");
- d3 = document.getElementById("location");
- d4 = document.getElementById("Contact");
- //colors the nav1 to yellow
- n1.style.background = highLight;
- }
- function showTab(tab) {
- // tab 1 = home 2 = budget 3 = location 4 = contact
- //alert(tab);
- if(tab ==1) {
- n1.style.background = highLight;
- n2.style.background = normal;
- n3.style.background = normal;
- n4.style.background = normal;
- d1.style.display = "block";
- d2.style.display = "none";
- d3.style.display = "none";
- d4.style.display = "none";
- }
- if(tab ==2) {
- n1.style.background = normal;
- n2.style.background = highLight;
- n3.style.background = normal;
- n4.style.background = normal;
- d1.style.display = "none";
- d2.style.display = "block";
- d3.style.display = "none";
- d4.style.display = "none";
- }
- if(tab ==3) {
- n1.style.background = normal;
- n2.style.background = normal;
- n3.style.background = highLight;
- n4.style.background = normal;
- d1.style.display = "none";
- d2.style.display = "none";
- d3.style.display = "block";
- d4.style.display = "none";
- }
- if(tab ==4) {
- n1.style.background = normal;
- n2.style.background = normal;
- n3.style.background = normal;
- n4.style.background = highLight;
- d1.style.display = "none";
- d2.style.display = "none";
- d3.style.display = "none";
- d4.style.display = "block";
- }
- }
- </script>
- <title> Business Application </title>
- </head>
- <body onLoad="init()">
- <main>
- <nav>
- <a href="#" id="nav1" onclick="showTab(1)">Home</a>
- <a href="#" id="nav2" onclick="showTab(2)">Budget</a>
- <a href="#" id="nav3" onclick="showTab(3)">Location</a>
- <a href="#" id="nav4" onclick="showTab(4)">Contact</a>
- </nav>
- <div id="home">
- <h1>Development made simple - Home</h1>
- <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
- tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
- quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
- consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
- cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
- proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
- tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
- quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
- consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
- cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
- proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
- </div> <!-- closing of home -->
- <div id="budget">
- <h1>Budget Slider</h1>
- </div> <!-- budget end-->
- <div id="location">
- <h1>North Bay City Hall</h1>
- </div> <!-- location end-->
- <div id="contact">
- <h1>Contact Us</h1>
- </div> <!-- contact end-->
- <footer>
- <a href="http://www.developmentmadesimple.com" target="new">Development made simple</a> © 2015
- </footer>
- </main>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement