[ FlashTooltip]
ToolTip Me
Beispiel der
Kombination von JavaScript und Flash. Beim Überfahren eines Links
wird ein Tooltip eingeblendet, der auf auf einem Flash- Objekt basiert.
Die Beschriftungen des Tooltips werden über JavaScript gesteuert.
[Kompatibilität]
[ zwischen <HEAD> und </HEAD>]
<style type="text/css">
<!--
#ToolTip{position:absolute; width: 100px; top: 100px; left: 100px; z-index:4; visibility:hidden;}
-->
</style>
<script language = "JavaScript">
<!--
var ie = document.all ? 1 : 0
var ns = document.layers ? 1 : 0
if(ns){doc = "document."; sty = ""}
if(ie){doc = "document.all."; sty = ".style"}
var initialize = 0
var Ex, Ey, topColor, subColor, ContentInfo
if(ie){
Ex = "event.x"
Ey = "event.y"
topColor = "#808080"
subColor = "#C0C0C0"
}
if(ns){
Ex = "e.pageX"
Ey = "e.pageY"
window.captureEvents(Event.MOUSEMOVE)
window.onmousemove=overhere
topColor = "#808080"
subColor = "#C0C0C0"
}
function MoveToolTip(layerName, FromTop, FromLeft, e){
if(ie){eval(doc + layerName + sty + ".top = " + (eval(FromTop) + document.body.scrollTop))}
if(ns){eval(doc + layerName + sty + ".top = " + eval(FromTop))}
eval(doc + layerName + sty + ".left = " + (eval(FromLeft) + 15))
}
function ReplaceContent(layerName){
if(ie){document.all[layerName].innerHTML = ContentInfo}
if(ns){
with(document.layers[layerName].document)
{
open();
write(ContentInfo);
close();
}
}
}
function Activate(){initialize=1}
function deActivate(){initialize=0}
function overhere(e){
if(initialize && ie){
MoveToolTip("ToolTip", Ey, Ex, e)
eval(doc + "ToolTip" + sty + ".visibility = 'visible'")
}
else{
MoveToolTip("ToolTip", 0, 0)
eval(doc + "ToolTip" + sty + ".visibility = 'hidden'")
}
}
function EnterContent(TTitle, TContent){
if(ie){
window.document.tooltip.SetVariable("tooltiptitle", TTitle);
window.document.tooltip.SetVariable("tooltipcontent", TContent);
}
}
//-->
</script>
[ in den <BODY> Tag]
onmousemove="overhere()"
[ zwischen <BODY> und </BODY>]
<div
id="ToolTip">
<OBJECT
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
WIDTH=255
HEIGHT=125 name=tooltip swLiveConnect=true>
<PARAM
NAME=movie VALUE="tt4.swf?coloringit=808080">
<PARAM
NAME=loop VALUE=false>
<PARAM
NAME=menu VALUE=false>
<PARAM
NAME=quality VALUE=high>
<PARAM
NAME=scale VALUE=noborder>
<PARAM
NAME=wmode VALUE=transparent>
<PARAM
NAME=bgcolor VALUE=#999999>
<EMBED
src="tt4.swf?coloringit=808080" loop=false menu=false quality=high scale=noborder
wmode=transparent bgcolor=#999999 name=tooltip swLiveConnect=true WIDTH=255
HEIGHT=125 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>
</OBJECT>
</div>
Der Aufruf
erfolgt über einen normalen Link:
<a href="javascript:void(0)"
onMouseover="EnterContent('Nightfire Java ','sagenhaft
viele Applets und Scripts '); Activate();"
onMouseout="deActivate()">ToolTip Me</a>
[ ]
GUIstuff.com
[ ]
Verwenden Sie unseren Flash- Tooltip- Generator