C-begin
asked on
Information Window on mouseover Link
Hi,
I want to make a window (NOT A POP UP) but an information window appear when onmouseover event occurs. The page will have many links and each link will have it's own inforamtion window which will have links inside them.
Could that be done with CSS or sinply in javascript
Here sample of what I want
------Code----------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<style type="text/css">
#dhtmlfloatie{
position: absolute;
left: 0;
left: -500px;
filter:alpha(opacity=0);
-moz-opacity:0;
border: 2px solid black;
padding: 5px;
z-index: 100;
}
</style>
<script type="text/javascript">
var floatiewidth="250px" //default width of floatie in px
var floatieheight="60px" //default height of floatie in px. Set to "" to let floatie content dictate height.
var floatiebgcolor="lightblue" //default bgcolor of floatie
var fadespeed=50 //speed of fade (5 or above). Smaller=faster.
var baseopacity=5
function slowhigh(which2){
imgobj=which2
browserdetect=which2.filte rs? "ie" : typeof which2.style.MozOpacity==" string"? "mozilla" : ""
instantset(baseopacity)
highlighting=setInterval(" gradualfad e(imgobj)" ,fadespeed )
}
function instantset(degree){
cleartimer()
if (browserdetect=="mozilla")
imgobj.style.MozOpacity=de gree/100
else if (browserdetect=="ie")
imgobj.filters.alpha.opaci ty=degree
}
function cleartimer(){
if (window.highlighting) clearInterval(highlighting )
}
function gradualfade(cur2){
if (browserdetect=="mozilla" && cur2.style.MozOpacity<1)
cur2.style.MozOpacity=Math .min(parse Float(cur2 .style.Moz Opacity)+0 .1, 0.99)
else if (browserdetect=="ie" && cur2.filters.alpha.opacity <100)
cur2.filters.alpha.opacity +=10
else if (window.highlighting)
clearInterval(highlighting )
}
function ietruebody(){
return (document.compatMode && document.compatMode!="Back Compat")? document.documentElement : document.body
}
function paramexists(what){
return(typeof what!="undefined" && what!="")
}
/*get the mouse coordinate*/
function mousemove(e) {
if (ns4) {var mouseX=e.pageX; var mouseY=e.pageY}
if (ie4) {var mouseX=event.x; var mouseY=event.y}
status="x= "+mouseX+", y= "+mouseY;
}
function showfloatie(thetext, e, optbgColor, optWidth, optHeight){
var dsocx=(window.pageXOffset) ? pageXOffset: ietruebody().scrollLeft;
var dsocy=(window.pageYOffset) ? pageYOffset : ietruebody().scrollTop;
var floatobj=document.getEleme ntById("dh tmlfloatie ")
floatobj.style.left="-200p x"
floatobj.style.display="bl ock"
floatobj.style.backgroundC olor=param exists(opt bgColor)? optbgColor : floatiebgcolor
floatobj.style.width=param exists(opt Width)? optWidth+"px" : floatiewidth
floatobj.style.height=para mexists(op tHeight)? optHeight+"px" : floatieheight!=""? floatieheight : ""
floatobj.innerHTML=thetext
var floatWidth=floatobj.offset Width>0? floatobj.offsetWidth : floatobj.style.width
var floatHeight=floatobj.offse tHeight>0? floatobj.offsetHeight : floatobj.style.width
var winWidth=document.all&&!wi ndow.opera ? ietruebody().clientWidth : window.innerWidth-20
var winHeight=document.all&&!w indow.oper a? ietruebody().clientHeight : window.innerHeight
e=window.event? window.event : e
floatobj.style.left=dsocx+ winWidth-f loatWidth- 25+"px"
if (e.clientX>winWidth-floatW idth && e.clientY+20>winHeight-flo atHeight)
floatobj.style.top=dsocy+5 +"px"
else
floatobj.style.top=dsocy+w inHeight-f loatHeight -5+"px"
slowhigh(floatobj)
}
</script>
</head>
<body>
<div id="dhtmlfloatie" ></div>
<a href="#" onMouseover="showfloatie(' <strong>Te xt 1A</strong><br />Text 1B', event)" >Text 1</a><br />
<a href="#" onMouseover="showfloatie(' <strong>Te xt 2A</strong><br />Text 2B', event)" >Text 2</a><br/>
</body>
</html>
-----end code----
Thank You
C-B
I want to make a window (NOT A POP UP) but an information window appear when onmouseover event occurs. The page will have many links and each link will have it's own inforamtion window which will have links inside them.
Could that be done with CSS or sinply in javascript
Here sample of what I want
------Code----------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<style type="text/css">
#dhtmlfloatie{
position: absolute;
left: 0;
left: -500px;
filter:alpha(opacity=0);
-moz-opacity:0;
border: 2px solid black;
padding: 5px;
z-index: 100;
}
</style>
<script type="text/javascript">
var floatiewidth="250px" //default width of floatie in px
var floatieheight="60px" //default height of floatie in px. Set to "" to let floatie content dictate height.
var floatiebgcolor="lightblue"
var fadespeed=50 //speed of fade (5 or above). Smaller=faster.
var baseopacity=5
function slowhigh(which2){
imgobj=which2
browserdetect=which2.filte
instantset(baseopacity)
highlighting=setInterval("
}
function instantset(degree){
cleartimer()
if (browserdetect=="mozilla")
imgobj.style.MozOpacity=de
else if (browserdetect=="ie")
imgobj.filters.alpha.opaci
}
function cleartimer(){
if (window.highlighting) clearInterval(highlighting
}
function gradualfade(cur2){
if (browserdetect=="mozilla" && cur2.style.MozOpacity<1)
cur2.style.MozOpacity=Math
else if (browserdetect=="ie" && cur2.filters.alpha.opacity
cur2.filters.alpha.opacity
else if (window.highlighting)
clearInterval(highlighting
}
function ietruebody(){
return (document.compatMode && document.compatMode!="Back
}
function paramexists(what){
return(typeof what!="undefined" && what!="")
}
/*get the mouse coordinate*/
function mousemove(e) {
if (ns4) {var mouseX=e.pageX; var mouseY=e.pageY}
if (ie4) {var mouseX=event.x; var mouseY=event.y}
status="x= "+mouseX+", y= "+mouseY;
}
function showfloatie(thetext, e, optbgColor, optWidth, optHeight){
var dsocx=(window.pageXOffset)
var dsocy=(window.pageYOffset)
var floatobj=document.getEleme
floatobj.style.left="-200p
floatobj.style.display="bl
floatobj.style.backgroundC
floatobj.style.width=param
floatobj.style.height=para
floatobj.innerHTML=thetext
var floatWidth=floatobj.offset
var floatHeight=floatobj.offse
var winWidth=document.all&&!wi
var winHeight=document.all&&!w
e=window.event? window.event : e
floatobj.style.left=dsocx+
if (e.clientX>winWidth-floatW
floatobj.style.top=dsocy+5
else
floatobj.style.top=dsocy+w
slowhigh(floatobj)
}
</script>
</head>
<body>
<div id="dhtmlfloatie" ></div>
<a href="#" onMouseover="showfloatie('
<a href="#" onMouseover="showfloatie('
</body>
</html>
-----end code----
Thank You
C-B
does the title attribute of the a element do what you want? (example: <a href="#" title="Text 1A">Text1</a> )
ASKER
For now yes, but once the info widow appear near it's link That could be easily changed
I'm not understanding exactly what your after. What do you need that is different from the behavior of the code that you posted?
Do you want some sort of tooltip?
http://www.walterzorn.com/tooltip/tooltip_e.htm
Do you want some sort of tooltip?
http://www.walterzorn.com/tooltip/tooltip_e.htm
ASKER
Yes some sort of Tool tip like in here (http://www.walterzorn.com/tooltip/tooltip_e.htm) like the Commands Link. But I want that on Multiple Link
C-B
C-B
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.