From a6c2695d36ff7773e4e0b82236bb5f39b1bc0bdb Mon Sep 17 00:00:00 2001 From: Robert Konigsberg Date: Mon, 27 Feb 2012 08:04:37 -0500 Subject: [PATCH] Gallery code links reset the URL anchor. This fixes it. --- gallery/gallery.css | 5 +++++ gallery/gallery.js | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/gallery/gallery.css b/gallery/gallery.css index 7bd3510..74bbbef 100644 --- a/gallery/gallery.css +++ b/gallery/gallery.css @@ -47,6 +47,11 @@ aside { color: #090; } +#code a:hover { + color: blue; + cursor: pointer; +} + #demotitle { text-align: center; font-size: 1.5em; diff --git a/gallery/gallery.js b/gallery/gallery.js index b735693..121f541 100644 --- a/gallery/gallery.js +++ b/gallery/gallery.js @@ -53,23 +53,23 @@ Gallery.start = function() { Gallery.demotitle.textContent = demo.title ? demo.title : ""; demo.innerDiv.className = "selected"; - var htmlLink = Gallery.create("a", Gallery.subtitle); + var codeSpan = Gallery.create("span", Gallery.subtitle); + codeSpan.id = "code"; + + var htmlLink = Gallery.create("a", codeSpan); htmlLink.textContent = "HTML"; - htmlLink.href = "#"; - Gallery.subtitle.appendChild(document.createTextNode(" ")); + codeSpan.appendChild(document.createTextNode(" ")); - var javascriptLink = Gallery.create("a", Gallery.subtitle); + var javascriptLink = Gallery.create("a", codeSpan); javascriptLink.textContent = "Javascript"; - javascriptLink.href = "#"; - Gallery.subtitle.appendChild(document.createTextNode(" ")); + codeSpan.appendChild(document.createTextNode(" ")); var css = getCss(id); if (css) { - var cssLink = Gallery.create("a", Gallery.subtitle); + var cssLink = Gallery.create("a", codeSpan); cssLink.textContent = "CSS"; - cssLink.href = "#"; } Gallery.workareaChild.id = id; -- 2.7.4