0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-11-29 11:24:18 +01:00

Made JavaScript unobtrusive by factoring out prettyPrint() to application.js. Also removed unused class from hero demo.

This commit is contained in:
Karthik Viswanathan 2011-08-26 00:00:05 -07:00
parent cf47ef0b2e
commit 0a34a6d4b2
3 changed files with 18 additions and 6 deletions

View File

@ -1,10 +1,22 @@
$(document).ready(function(){
// Google code prettify
// ================
// cache $(window), as it is used in scroll spy logic later on
var $window = $(window);
$window.load(function() {
// prettyPrint cannot be set as the event handler to load directly; see
// http://google-code-prettify.googlecode.com/svn/trunk/README.html
prettyPrint();
});
// scroll spy logic
// ================
var activeTarget,
$window = $(window),
position = {},
nav = $('body > .topbar li a'),
targets = nav.map(function () {

View File

@ -29,7 +29,7 @@
<link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
</head>
<body onload="prettyPrint();">
<body>
<!-- Topbar
================================================== -->

View File

@ -25,7 +25,7 @@
<div class="topbar">
<div class="fill">
<div class="container fixed">
<div class="container">
<h3><a href="#">Project name</a></h3>
<ul>
<li class="active"><a href="#">Home</a></li>