Permalink
Browse files

Use a combo

  • Loading branch information...
1 parent 22d39ec commit 47acc03c5b05d32a986d5e3e18cb12a6c4f2fa39 @aslakhellesoy committed Jan 3, 2011
Showing with 14 additions and 15 deletions.
  1. +10 −12 _layouts/default.html
  2. +4 −3 js/backend.js
View
@@ -21,18 +21,16 @@
<a class="extra" href="/">home</a>
</div>
- <div id="backend">
- <ul>
- <li><img id="ruby" alt="Ruby" src="/images/ruby.png" /></li>
- <li><img id="java" alt="Java" src="/images/java.png" /></li>
- <li><img id="csharp" alt="C#" src="/images/dotnet.png" /></li>
- <li><img id="scala" alt="Scala" src="/images/scala.png" /></li>
- <li><img id="groovy" alt="Groovy" src="/images/groovy.png" /></li>
- <li><img id="clojure" alt="Clojure" src="/images/clojure.png" /></li>
- <li><img id="javascript" alt="Javascript" src="/images/rhino.png" /></li>
- <li><img id="ioke" alt="Ioke" src="/images/ioke.png" /></li>
- </ul>
- </div>
+ <select id="backend">
+ <option value="ruby">Ruby</option>
+ <option value="java">Java</option>
+ <option value="javascript">Javascript</option>
+ <option value="csharp">C#</option>
+ <option value="scala">Scala</option>
+ <option value="groovy">Groovy</option>
+ <option value="clojure">Clojure</option>
+ <option value="ioke">Ioke</option>
+ </select>
{{ content }}
View
@@ -1,4 +1,4 @@
-
+(function() {
function showBackend(backend) {
$.each(["ruby", "java", "csharp", "scala", "groovy", "clojure", "javascript", "ioke"], function(i, b) {
$("." + b).hide();
@@ -19,6 +19,7 @@
showBackend($.cookie('backend') || "ruby");
- $("#backend img").click(function(e) {
- showBackend(e.target.id);
+ $("#backend").change(function(e) {
+ showBackend(this.value);
});
+})();

0 comments on commit 47acc03

Please sign in to comment.