Last active
August 29, 2015 14:06
-
-
Save icyflame/721b4790e1a6e09ec5d5 to your computer and use it in GitHub Desktop.
Basic Template for almost all HTML files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="http://code.jquery.com/jquery-1.11.1.js"></script> | |
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> | |
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> | |
<link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet"> | |
<link href="http://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet"> | |
<style> | |
.navbar a{ | |
-webkit-transition: all 0.5s ease-out; | |
-moz-transition: all 0.5s ease-out; | |
-o-transition: all 0.5s ease-out; | |
transition: all 0.5s ease-out; | |
} | |
.navbar a:hover{ | |
-webkit-transition: all 0.5s ease-out; | |
-moz-transition: all 0.5s ease-out; | |
-o-transition: all 0.5s ease-out; | |
transition: all 0.5s ease-out; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="navbar navbar-default" role="navigation"> | |
<div class="container-fluid"> | |
<div class="navbar-header"> | |
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse"> | |
<span class="sr-only">Toggle navigation</span> | |
<span class="icon-bar"></span> | |
<span class="icon-bar"></span> | |
<span class="icon-bar"></span> | |
</button> | |
<a class="navbar-brand" href="#">Project name</a> | |
</div> | |
<div class="navbar-collapse collapse"> | |
<ul class="nav navbar-nav"> | |
<li class="active"><a href="#">Link</a></li> | |
<li><a href="#">Link</a></li> | |
<li><a href="#">Link</a></li> | |
<li class="dropdown"> | |
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <span class="caret"></span></a> | |
<ul class="dropdown-menu" role="menu"> | |
<li><a href="#">Action</a></li> | |
<li><a href="#">Another action</a></li> | |
<li><a href="#">Something else here</a></li> | |
<li class="divider"></li> | |
<li class="dropdown-header">Nav header</li> | |
<li><a href="#">Separated link</a></li> | |
<li><a href="#">One more separated link</a></li> | |
</ul> | |
</li> | |
</ul> | |
<ul class="nav navbar-nav navbar-right"> | |
<li class="active"><a href="./">Default</a></li> | |
<li><a href="../navbar-static-top/">Static top</a></li> | |
<li><a href="../navbar-fixed-top/">Fixed top</a></li> | |
</ul> | |
</div><!--/.nav-collapse --> | |
</div><!--/.container-fluid --> | |
</div> | |
<div class="container-fluid"> | |
</div> | |
</body> | |
<script> | |
</script> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// code for smooth scrolling when navigating within the page | |
$(function () { | |
$('a[href*=#]:not([href=#])').click(function () { | |
if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) { | |
var target = $(this.hash); | |
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); | |
if (target.length) { | |
$('html,body').animate({ | |
scrollTop: target.offset().top | |
}, 1000); | |
return false; | |
} | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment