Ahot's weblog

Thursday Aug 14, 2008

Realy useful thing. No hints - no money. :)


You can read this entry in my new blog

Source code:
<A href="javascript:void(0);"  onmouseover="showhint(this, '$100 000 000')">money</A>

<STYLE>
	.hintstyle {
		position:absolute;
		background:#EEEEEE;
		border:1px solid black;
		padding:2px;
	}
</STYLE>

<SCRIPT>
var hintcontainer = null;
function showhint(obj, txt) {
   if (hintcontainer==null) {
	  hintcontainer = document.createElement("div");
	  hintcontainer.className="hintstyle";
	  document.body.appendChild(hintcontainer);
   }
   obj.onmouseout = hidehint;
   obj.onmousemove=movehint;
   hintcontainer.innerHTML=txt;
}
function movehint(e) {
	if (!e) e = event; //line for IE compatibility
	hintcontainer.style.top =  (e.clientY+document.documentElement.scrollTop+2)+"px";
	hintcontainer.style.left = (e.clientX+document.documentElement.scrollLeft+10)+"px";
	hintcontainer.style.display="";
}
function hidehint() {
   hintcontainer.style.display="none";
}
</SCRIPT>
Comments:

THX:-)

Posted by Patryk from Poland on June 20, 2009 at 11:50 PM GMT+03:00 #

Cool code, much better then similar offers in 600-900 lines.

Posted by myaddr on November 02, 2009 at 07:36 PM GMT+03:00 #

Post a Comment:
  • HTML Syntax: NOT allowed

FEEDS:

BOOKMARKS:

This blog copyright 2009 by ahot