Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CSS
- <style>
- a,a:hover, img,img:hover{
- position: relative;
- display: inline-block;
- }
- a[data]:hover::after {
- position: absolute;
- top: 75% !important;
- left: 50%;
- transform: translateX(-50%);
- content: attr(data);
- background: ghostwhite;
- padding: 5px;
- z-index: 9999;
- font-size: 11px;
- display: block;
- }
- </style>
- JS
- <script>
- $(document).ready(function(){
- $('a').each( function(){
- if (typeof $(this).attr('title') !== typeof undefined && $(this).attr('title') !== false) {
- $(this).attr('data', $(this).attr('title'));
- }
- });
- $('img').each(function(){
- if (typeof $(this).attr('alt') !== typeof undefined && $(this).attr('alt') !== false) {
- $(this).attr('data', $(this).attr('alt'));
- }
- });
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement