/ Cool DHTML Tooltip

Cool DHTML Tooltip

Cool DHTML Tooltip

 

<style type=”text/css”>

#dhtmltooltip{
position: absolute;
width: 150PX;
border: 2px solid black;
padding: 2PX;
background-color: lightyellow;
visibility: hidden;
z-index: 100;
/*Remove below line to remove shadow. Below line should always appear last within this CSS*/
filter: progid:DXImageTransform.Microsoft.Shadow(color=gray,direction=135);
}

</style>

<DIV ID =”dhtmltooltip”></DIV>

<script type=”文/ JavaScript的”>

 

var offsetxpoint=-60 //Customize x offset of tooltip

var offsetypoint=20 //Customize y offset of tooltip
var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
如果 (ie||ns6)
var tipobj=document.all? document.all[“dhtmltooltip”] : 的document.getElementById? 的document.getElementById(“dhtmltooltip”) : “”

function ietruebody(){
返回 (document.compatMode && document.compatMode!=”BackCompat”)? document.documentElement : document.body
}

function ddrivetip(thetext, thecolor, thewidth){
如果 (ns6||ie){
如果 (typeof thewidth!=”undefined”) tipobj.style.width=thewidth+”PX”
如果 (typeof thecolor!=”undefined” && thecolor!=””) tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false
}
}

function positiontip(e){
如果 (enabletip){
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20
var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20

var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000

//if the horizontal distance isn’t enough to accomodate the width of the context menu
如果 (rightedge<tipobj.offsetWidth)
//move the horizontal position of the menu to the left by it’s width
tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+”PX” : window.pageXOffset+e.clientX-tipobj.offsetWidth+”PX”
else if (curX<leftedge)
tipobj.style.left=”5PX”
else
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetxpoint+”PX”

//same concept with the vertical position
如果 (bottomedge<tipobj.offsetHeight)
tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+”PX” : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+”PX”
else
tipobj.style.top=curY+offsetypoint+”PX”
tipobj.style.visibility=”visible”
}
}

function hideddrivetip(){
如果 (ns6||ie){
enabletip=false
tipobj.style.visibility=”hidden”
tipobj.style.left=”-1000PX”
tipobj.style.backgroundColor=”
tipobj.style.width=”
}
}

document.onmousemove=positiontip

</腳本>

<A HREF =”HTTP://www.yahoo.com” onMouseover=”ddrivetip(‘Visit Yahoo.com’)”;
onMouseout=”hideddrivetip()”>Search Engine</一個>

還要檢查

李國主

把你的冰箱李國主baknarae對決的護理

把你的冰箱李國主baknarae對決冠軍的護理? 把你的冰箱的護理,第一位嘉賓baknarae李國主烹飪對決 …

發表評論

您的電子郵件地址不會被公開. 必需的地方已做標記 *