Solved

Mouse over text

Posted on 2003-10-21
4
225 Views
Last Modified: 2010-04-09
Hello,

Is there a possibility when you want to create a mouseover text of a regular text (by using <span title=""> for example) to format the mouseover text.

Example by mouse over of the text "Register" the following text should appear:

                          * Click on this button
                          * Fill in the form
                          * Click Submit

Thanks in advance
0
Comment
Question by:bvdm23
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 31

Accepted Solution

by:
seanpowell earned 100 total points
ID: 9590787
Somethng like this should work for you (IE and Netscape):
<html>
<head>
<script>
function showtip(current,e,text)
{
   if (document.all)
   {
      thetitle=text.split('<br>')
      if (thetitle.length > 1)
      {
        thetitles=""
        for (i=0; i<thetitle.length; i++)
           thetitles += thetitle[i] + "\r\n"
        current.title = thetitles
      }
      else current.title = text
   }

   else if (document.layers)
   {
       document.tooltip.document.write(
           '<layer bgColor="#FFFFE7" style="border:1px ' +
           'solid black; font-size:12px;color:#000000;">' + text + '</layer>')
       document.tooltip.document.close()
       document.tooltip.left=e.pageX+5
       document.tooltip.top=e.pageY+5
       document.tooltip.visibility="show"
   }
}

function hidetip()
{
    if (document.layers)
        document.tooltip.visibility="hidden"
}
</script>
</head>
<body>
<div id=tooltip style="position:absolute;visibility:hidden"></div>
<A href="#" onmouseover="showtip(this,event,'* Click on this button<br>* Fill in the form<br>* Click Submit')" onmouseout="hidetip()">Register</a>
</body>
</html>
0
 
LVL 2

Expert Comment

by:RichardAllsebrook
ID: 9591176
If you want to do something clever with your mouse overs, i can heartily recommend overLIB ( http://www.bosrup.com/web/overlib/ )

It does everthing you need and loads more.
0
 

Expert Comment

by:lbyi
ID: 9596460
hi bvdm23

give this a try

<span title="* Click on this button
* Fill in the form
* Click Submit">Register
</span>

works in explorer only - carriage return creates the newline

cheers
0
 
LVL 15

Expert Comment

by:VincentPuglia
ID: 9600189
Hi,

And yet another tested version:

<html>
<head>
<script>

var txtArray = new Array();
 txtArray[0] = "<ul><ol>* Click on this button</ol><ol>* Fill in the form</ol><ol>* Click Submit</ol></ul>"
 txtArray[1] = "<ul><ol>* Click on this button</ol><ol>* Jump up and down twice</ol><ol>* Go home and wait</ol></ul>"


function doit(showDiv, divID, txtNdx)
{

var txt = txtArray[txtNdx];

var  divObj = (document.layers) ? document.layers[divID] : (document.all) ? document.all[divID] : document.getElementById(divID);

if (document.layers)
{
  divObj.document.open();
  divObj.document.write(txt);
  divObj.document.close();
}
else
{
  divObj.innerHTML = txt;
}
var divStyle =  (document.layers) ? divObj : divObj.style;

divStyle.visibility = (showDiv) ? 'visible' : 'hidden';
}
</script>
</head>
<body>
<div id="theDiv" style="position:absolute;visibility:hidden"></div>
<A href="#" onmouseover="doit(1, 'theDiv',0)" onmouseout="doit(0, 'theDiv',0)">Register</a><br />
<A href="#" onmouseover="doit(1, 'theDiv',1)" onmouseout="doit(0, 'theDiv',1)">Unregister</a>
</body>
</html>

Vinny
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question