Skip to content

Instantly share code, notes, and snippets.

@icebreaker
Created June 17, 2010 07:36
Show Gist options
  • Select an option

  • Save icebreaker/441804 to your computer and use it in GitHub Desktop.

Select an option

Save icebreaker/441804 to your computer and use it in GitHub Desktop.
if(location.pathname=="/"||location.pathname.match(/\/\d+\//))
{
var mc=document.getElementById("middleContent");
var img=mc.getElementsByTagName("img")[0];
var title=img.title;
img.removeAttribute("title");
var imgParent=img.parentNode;
var afterImg=img.nextSibling;
imgParent.insertBefore(document.createElement("br"),afterImg);
imgParent.insertBefore(document.createElement("br"),afterImg);
var newNode=document.createElement("div");
newNode.appendChild(document.createTextNode(title));
newNode.setAttribute("id","hoverText");
imgParent.insertBefore(newNode,afterImg);
img.onmouseover=function(){document.getElementById("hoverText").removeAttribute("style");};
img.onmouseout=function(){document.getElementById("hoverText").setAttribute("style","color: white");};
img.onmouseout();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment