Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

JS hackery is the new spinnin flaming skull image

  • Loading branch information...
commit 0d9da6a51adf10bb3b0904ad91693cbd75ab8f94 1 parent b458276
@amtal authored
Showing with 29 additions and 1 deletion.
  1. +1 −1  _layouts/default.html
  2. +17 −0 _layouts/post.html
  3. +11 −0 css/screen.css
View
2  _layouts/default.html
@@ -12,7 +12,7 @@
<link rel="stylesheet" href="/css/screen.css" type="text/css" media="screen, projection" />
<!-- MICE -->
<link href="http://www.enflock.com/enflock.css" rel="stylesheet" type="text/css"/>
-
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
</head>
<body>
View
17 _layouts/post.html
@@ -14,6 +14,23 @@
</ul>
</div>
+<div id="toc">
+ <script>
+ // based on Janko Jovanovic's example
+ $('document').ready(function(){
+ $('#post h1, #post h2, #post h3').each(function(i){
+ var c = $(this)
+ c.attr('id','title'+i)
+ var pos = c.position().top / $('div.site').height() * $(window).height()
+ $('#toc').append("<a id='link"+i+"' href='#title"+i+"' title='"+c.attr("tagName")+"'>"+
+ ((i==0)?'^' : (c.html().toLowerCase()+" &gt"))+"</a>")
+ $('#link'+i).css('top',pos)
+ })
+ })
+ </script>
+</div>
+
+
<!-- blog comments powered by Disqus -->
<div id="disqus_thread"></div>
<script type="text/javascript">
View
11 css/screen.css
@@ -153,6 +153,17 @@ ul.posts {
/*
/*****************************************************************************/
+#toc a {
+ display:block;
+ text-align:right;
+ position:fixed;
+ right:0;
+ color:#b0b0ba;
+ text-decoration:none;
+ margin-right:0.2em;
+}
+#toc a[title=H2] {font-weight:bold;}
+
#post {
}
Please sign in to comment.
Something went wrong with that request. Please try again.