Solved

How to show tooltip  for Li tag

Posted on 2015-01-13
2
1,010 Views
Last Modified: 2015-01-14
Hello,
  I have an li tag with some data. i would like to show the user the first 20 char of string and then onhover display the entire text

How can i do this?

<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>test</title>

</head>
<body>
<ul>
  
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing 
  elit. Aenean commodo ligula eget dolor. Aenean 
  massa.</li>
  
<li>Cum sociis natoque penatibus et magnis dis 
  parturient montes, nascetur ridiculus mus. Donec quam 
  felis, ultricies nec, pellentesque eu, pretium quis, 
  sem.</li>
  
<li>Nulla consequat massa quis enim. Donec pede justo, 
  fringilla vel, aliquet nec, vulputate eget, arcu.</li>
  
<li>In enim justo, rhoncus ut, imperdiet a, venenatis 
  vitae, justo. Nullam dictum felis eu pede mollis 
  pretium. Integer tincidunt.</li>


</ul>

  
</body>
</html>

Open in new window

0
Comment
Question by:SiemensSEN
2 Comments
 
LVL 14

Accepted Solution

by:
Edwin Hoffer earned 450 total points
ID: 40548217
What about this:

<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>test</title>
</head>
<body>
<ul>
<li><span title="Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa.">Lorem ipsum dolor si...</span></li>
<li><span title="Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem.">Cum sociis natoque ...</span></li>
<li><span title="Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu.">Nulla consequat mass...</span></li>
<li><span title="In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt.">In enim justo, rhonc...</span></li>
</ul>
</body>
</html>

Open in new window

0
 
LVL 10

Assisted Solution

by:Jeffrey Dake
Jeffrey Dake earned 50 total points
ID: 40548280
I am pretty sure you don't even need the span. Just put the title straight on the li.  http://www.w3schools.com/tags/ref_standardattributes.asp
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

867 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now