<?xml version='1.0' encoding='UTF-8'?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-34108670</id><updated>2007-05-31T06:47:12.689-07:00</updated><title type='text'>Javascript Programming</title><link rel='alternate' type='text/html' href='http://www.calcaria.net/javascript/'></link><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34108670/posts/default'></link><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.calcaria.net/javascript/atom.xml'></link><author><name>Paul Maddox</name></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-34108670.post-115779831452576560</id><published>2006-09-09T03:35:00.000-07:00</published><updated>2006-09-09T03:54:35.886-07:00</updated><title type='text'>Javascript hover-over HTML popup</title><content type='html'>I've recently needed to create some Javascript to show a small hover-over popup when the mouse is over a HTML element. A working sample can be found &lt;a href="http://www.calcaria.net/javascript/hover-over_popup.html" target="_blank"&gt;here&lt;/a&gt;. View source to and copy it for your website.&lt;br /&gt;&lt;br /&gt;Script:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;function ShowPopup(hoveritem)&lt;br /&gt;{&lt;br /&gt;hp = document.getElementById("hoverpopup");&lt;br /&gt;&lt;br /&gt;// Set position of hover-over popup&lt;br /&gt;hp.style.top = hoveritem.offsetTop + 18;&lt;br /&gt;hp.style.left = hoveritem.offsetLeft + 20;&lt;br /&gt;&lt;br /&gt;// Set popup to visible&lt;br /&gt;hp.style.visibility = "Visible";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function HidePopup()&lt;br /&gt;{&lt;br /&gt;hp = document.getElementById("hoverpopup");&lt;br /&gt;hp.style.visibility = "Hidden";&lt;br /&gt;}&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Body:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000099;"&gt;&amp;lt;a id="hoverover" style="cursor:default;" onMouseOver="ShowPopup(this);" onMouseOut="HidePopup();"&amp;gt;Hover over me!&amp;lt;/a&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;br&amp;gt;This is some&amp;lt;br&amp;gt;incidental&amp;lt;br&amp;gt;Text.&lt;br /&gt;&lt;br /&gt;&amp;lt;div id="hoverpopup" style="visibility:hidden; position:absolute; top:0; left:0;"&amp;gt;&amp;lt;table bgcolor="#0000FF"&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;font color="#FFFFFF"&amp;gt;This is my popup&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&amp;lt;td bgcolor="#8888FF"&amp;gt;Hello I am a popup table&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;This sample uses a hidden div tag containing a table that forms your popup. When the mouse hovers over the target text (in this case an anchor, although it could be an image or anything else that uses the onMouseOver event) the function ShowPopup is called and the position of the popup is set to that of the target text (the offsetTop and offsetLeft members), the popup is then set to visible.&lt;br /&gt;&lt;br /&gt;You can find the &lt;a href="http://www.calcaria.net/javascript/hover-over_popup.html" target=_blank&gt;sample source here&lt;/a&gt;.</content><link rel='alternate' type='text/html' href='http://www.calcaria.net/javascript/2006/09/javascript-hover-over-html-popup.html'></link><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34108670/posts/default/115779831452576560'></link><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34108670/posts/default/115779831452576560'></link><author><name>Paul Maddox</name></author></entry></feed>