Hi Nisha
Ok i have one DHTML code at present . U just have to modify it > if u want it on button then call these function on button click. I think u can do that.
Just copy and paste it and save it as HTML file .
I hope this may help you.
Just try this with button click.
<HEAD><TITLE>Tooltip</TITLE>
<STYLE>.tooltip {
BACKGROUND: white; POSITION: absolute; VISIBILITY: hidden
}
</STYLE>
<SCRIPT>
var iDelay = 750 // Delay to hide in milliseconds
var iNSWidth=100 // Default width for netscape
var sDisplayTimer = null, oLastItem
function getRealPos(i,which) {
iPos = 0
while (i!=null) {
iPos += i["offset" + which]
i = i.offsetParent
}
return iPos
}
function showDetails(sDest,itop,ileft,iWidth) {
if (document.all) {
var i = window.event.srcElement
stopTimer()
dest = document.all[sDest]
if ((oLastItem!=null) && (oLastItem!=dest))
hideItem()
if (dest) {
// Netscape Hack
if (i.offsetWidth==0)
if (iWidth)
i.offsetWidth=iWidth
else
i.offsetWidth=iNSWidth;
if (ileft)
dest.style.pixelLeft = ileft
else
dest.style.pixelLeft = getRealPos(i,"Left") + i.offsetWidth + 5
if (itop)
dest.style.pixelTop = itop
else
dest.style.pixelTop = getRealPos(i,"Top")
dest.style.visibility = "visible"
}
oLastItem = dest
}
}
function stopTimer() {
clearTimeout(sDisplayTimer)
}
function startTimer(el) {
if (!el.contains(event.toElement)) {
stopTimer()
sDisplayTimer = setTimeout("hideItem()",iDelay)
}
}
function hideItem() {
if (oLastItem)
oLastItem.style.visibility="hidden"
}
function checkOver() {
if ((oLastItem) && (oLastItem.contains(event.srcElement)))
stopTimer()
}
function checkOut() {
if (oLastItem==event.srcElement)
startTimer(event.srcElement)
}
document.onmouseover = checkOver
document.onmouseout = checkOut
//-->
</SCRIPT>
</HEAD>
<BODY>
<DIV class=tooltip id=popup onmouseout=startTimer(event.srcElement)
style="WIDTH: 100px">
<TABLE bgColor=white border=1 width=100>
<TBODY>
<TR>
<TD><A
href="http://www.ideasnyou.com"
onclick="alert('You selected '+ this.innerText);return false">Ideasnyou.com
</A></TD></TR>
<TR>
<TD><A
href= mailto:"chanderjit@hotmail.com"
onclick="alert('You selected '+ this.innerText);return false">Chanderjit
</A></TD></TR>
<TR>
<TD><A
href="http://www.phpbuilder.com"
onclick="alert('You selected '+ this.innerText);return false">PHP BUILDER
</A></TD></TR>
<TR>
<TD><A
href="www.msn.co.uk"
onclick="alert('You selected '+ this.innerText);return false">MSN
</A></TD></TR></TBODY></TABLE></DIV><A
href="http://www.yahoo.com"
onclick="alert('You selected the demonstration');return false"
onmouseout=startTimer(this) onmouseover="showDetails('popup')">YAHOO
</A><BR><BR><BR><BR><BR><BR><BR><A
href="http:www.sun.java.com"
onclick="alert('You selected the demonstration');return false"
onmouseout=startTimer(this) onmouseover="showDetails('popup')">TEST
</A></BODY>
Let me know is it okay... If still not let me know
chander