Train Line
How do I make an train line?
(WIP) Train Line style navigation using pseudo elements.. What is a train line? How do you make a train line? This script and codes were developed by Mark Murray on 12 August 2022, Friday.
Train Line - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Train Line</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <ul> <li class='active'>Station 1</li> <li>Station 2</li> <li>Station 3</li> <li>Station 4</li>
</ul> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Train Line - Script Codes CSS Codes
@import url(http://fonts.googleapis.com/css?family=Open+Sans);
html, body { background: #2980b9; color: white;
}
ul { font-family: 'Open Sans', sans-serif; position: absolute; top: 50%; left: 50%; -moz-transform: translate(-50%, -50%); -ms-transform: translate(-50%, -50%); -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);
}
ul li.active:before { background: white;
}
ul li.active { opacity: 1;
}
ul li { display: inline-block; margin-right: 2em; position: relative; opacity: 0.8; cursor: pointer;
}
ul li:hover { opacity: 1;
}
ul li:last-of-type { margin: 0;
}
ul li:last-of-type:after { content: none;
}
ul li:before { content: ''; position: absolute; top: -200%; left: 50%; -moz-transform: translate(-50%); -ms-transform: translate(-50%); -webkit-transform: translate(-50%); transform: translate(-50%); width: 10px; height: 10px; -moz-border-radius: 50%; -webkit-border-radius: 50%; border-radius: 50%; background: transparent; border: 2px solid white; -moz-transition: background 0.5s ease; -o-transition: background 0.5s ease; -webkit-transition: background 0.5s ease; transition: background 0.5s ease;
}
ul li:after { content: ''; position: absolute; background: white; height: 2px; width: 92px; top: -160%; left: 58%;
}
Train Line - Script Codes JS Codes
(function($){ $('li').click(function(){ $('.active').removeClass('active'); $(this).addClass('active'); });
}(jQuery));
Developer | Mark Murray |
Username | markmurray |
Uploaded | August 12, 2022 |
Rating | 4.5 |
Size | 2,857 Kb |
Views | 26,312 |
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!
Name | Size |
Simple Loader | 2,728 Kb |
Full screen background parallax image | 3,758 Kb |
Various Share Button Styles | 5,263 Kb |
Services | 2,401 Kb |
Shopping List | 6,015 Kb |
Flex Blog Entries | 6,690 Kb |
Really Simple Slider | 3,900 Kb |
Flat Social Icons | 15,106 Kb |
Evaporation | 2,628 Kb |
Pull Flickr images using the Flickr API | 2,458 Kb |
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!
Name | Username | Size |
Fading Navigation Bar | J-w-v | 2,805 Kb |
HTML5 Breakout | Jaysalvat | 4,873 Kb |
Portfolio Page | HuffmanJ25 | 5,240 Kb |
Scroll effect with text with help from Skrollr | Luxonglassing | 2,935 Kb |
Flying Bee | Pwsm50 | 3,711 Kb |
Vertically rotating text with CSS | Nopr | 2,141 Kb |
Spinners using Font Icons | Keyamoon | 3,007 Kb |
Tic Tac Toe | Volv | 4,862 Kb |
Pictos font library from CodePen | Jstam | 3,790 Kb |
Foundation 5 Menu - Accessibility | Xporter | 1,999 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!