OSDN Git Service

docs: fix bug with unknown anchors
authorScott Main <smain@google.com>
Tue, 13 Nov 2012 13:58:23 +0000 (05:58 -0800)
committerScott Main <smain@google.com>
Tue, 13 Nov 2012 13:58:23 +0000 (05:58 -0800)
Change-Id: I70f978ffd2248973a43ff1fe1dec2b0ac78cb63b

docs/html/about/versions/jelly-bean.jd

index 1e21e0f..2680100 100644 (file)
@@ -42,8 +42,13 @@ function revealSection(hashy) {
     link = $("#version-tabs a[href$="+sectionId+"]");
     link.parent().addClass("selected");
     link.parent().siblings().removeClass("selected");
-    $(".version-section").hide();
-    $(link.attr("href")).show();
+    
+    sectionDiv = $(".version-section"+link.attr("href"));
+    if (sectionDiv.length) {
+      $(".version-section").hide();
+      sectionDiv.show();
+    }
+    
     $('html, body').animate({
          scrollTop: $(hashy).offset().top
      }, 100);