jquery - desciption text after hovering a profile picture -


i want display text after hovering profile picture. have made 'title 'tag cannot show text in different paragraphs. there alternative ways this?

here css code:

.tooltip {    display:none;    position:absolute;    border:1px solid #333;    background-color:#161616;    border-radius:5px;    padding:10px;    color:#fff;    font-size:12px arial; } 

here html code:

<table style="width:100%"> <tr> <td><a><img src="http://2017.igem.org/wiki/images/2/26/andrew.png" width="200" height="200" class="mastertooltip" title="name: ching yuet to; major/year: cell , molecular biology/3 "></a></td> <td><img src="http://2017.igem.org/wiki/images/d/de/venus.png" width="200" height="200"></td> <td><img src="http://2017.igem.org/wiki/images/8/84/cathy.png" width="200" height="200"></td> </tr> </table>  <script> $(function () {   $(document).tooltip({       content: function () {           return $(this).prop('title');       }   }); }); </script> 

this alternate way of doing it. few changes original code. hope helps.

a {    position: relative;  }  a:after {    position: absolute;    display: none;    content: attr(data-tooltip);    bottom: 0;    border: 1px solid #333;    background-color: #161616;    border-radius: 5px;    padding: 10px;    color: #fff;    font-size: 12px arial;  }  a:hover:after {    display: block;  }
<table style="width:100%">  <tr>  <td><a data-tooltip="name: ching yuet to; major/year: cell , molecular biology/3"><img src="http://2017.igem.org/wiki/images/2/26/andrew.png" width="200" height="200" class="mastertooltip"></a></td>    <td><a data-tooltip="tooltip"><img src="http://2017.igem.org/wiki/images/d/de/venus.png" width="200" height="200"></a></td>    <td><a data-tooltip="tooltip"><img src="http://2017.igem.org/wiki/images/8/84/cathy.png" width="200" height="200"></a></td>  </tr>  </table>


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -