/ Published in: CSS
So there is a little JS around setting the selected tab but they work perfectly without.
Expand |
Embed | Plain Text
<!DOCTYPE html> <html> <!-- Created using / Source can be edited via /uwixot/9/edit --> <head> <script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <meta charset=utf-8 /> <title>JS Bin</title> <!--[if IE]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <style> article, aside, figure, footer, header, hgroup, menu, nav, section { display: block; } #SlideWrapper {width: 300px; overflow: hidden;} #SlideHolder {width: 600px;} .slide { width: 300px; float: left;} .slideNav .selected a { background: aqua; } </style> </head> <body> <ul class="slideNav"> <li class="selected"><a href="#1">1</a></li> <li><a href="#2">2</a></li> </ul> <div id="SlideWrapper"> <div id="SlideHolder"> <div id="1" class="slide"> Some Content </div> <div id="2" class="slide"> Some other Content Some other Content Some other Content Some other Content Some other Content </div> </div> </div> <script> $(".slideNav a").click(function(){ var thisEle = $(this); var thisPar = thisEle.parent("li") var thisSib = thisPar.siblings(); thisPar.addClass("selected"); thisSib.removeClass("selected"); }); </script> </body> </html>
You need to login to post a comment.
