"Tugas WEB III"
Bootstrap 3.1.0 Snippet by Ichigo

<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <header role="banner" class="navbar navbar-fixed-top navbar-inverse"> <div class="container"> <div class="navbar-header"> <button data-toggle="collapse-side" data-target=".side-collapse" data-target-2=".side-collapse-container" type="button" class="navbar-toggle pull-left"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button> </div> <div class="navbar-inverse side-collapse in"> <nav role="navigation" class="navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="#validasi">Validasi</a></li> <li><a href="#user">User</a></li> <li><a href="#xss">anti-XSS</a></li> <li><a href="#captcha">Captcha</a></li> </ul> </nav> </div> </div> </header> <div class="container side-collapse-container"> <div class="row"> <h1>VALIDASI</h1> <form class="form-horizontal"> <div class="row"> </div> <!-- Text input--> <div class="form-group"> <label class="col-md-4 control-label" for="nama">Nama</label> <div class="col-md-4"> <input id="nama" name="nama" type="text" placeholder="placeholder" class="form-control input-md"> </div> </div> <!-- Text input--> <div class="form-group"> <label class="col-md-4 control-label" for="alamat">Alamat</label> <div class="col-md-4"> <input id="alamat" name="alamat" type="text" placeholder="placeholder" class="form-control input-md"> </div> </div> <!-- Text input--> <div class="form-group"> <label class="col-md-4 control-label" for="telpon">No. Telpon</label> <div class="col-md-4"> <input id="telpon" name="telpon" type="text" placeholder="placeholder" class="form-control input-md"> </div> </div> <!-- Button --> <div class="form-group"> <label class="col-md-4 control-label" for="submit"></label> <div class="col-md-4"> <button id="submit" name="submit" class="btn btn-primary">Submit</button> </div> </div> </fieldset> </form> </div> </div>
body { padding-top: 50px; position: relative; } pre { tab-size: 8; } @media screen and (max-width: 768px) { .side-collapse-container{ width:100%; position:relative; left:0; transition:left .4s; } .side-collapse-container.out{ left:200px; } .side-collapse { top:50px; bottom:0; left:0; width:200px; position:fixed; overflow:hidden; transition:width .4s; } .side-collapse.in { width:0; } }
$(document).ready(function() { var sideslider = $('[data-toggle=collapse-side]'); var sel = sideslider.attr('data-target'); var sel2 = sideslider.attr('data-target-2'); sideslider.click(function(event){ $(sel).toggleClass('in'); $(sel2).toggleClass('out'); }); });

Related: See More


Questions / Comments: