Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Mouse over text

Posted on 2003-10-21
4
Medium Priority
?
249 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 300 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
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 …
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

636 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