Articles in this section
Category / Section

How to overcome the positioning issue of Tooltip when the material theme is enabled

1 min read

Solution:

All Syncfusion Essential JS widgets are developed with a unique theme and different styling effects to improve its appearance and to have the unique look and feel. To apply material themes, please refer the following link.

Themes: https://help.syncfusion.com/js/theming-in-essential-javascript-components

When the material theme is enabled, the tooltip wrapper is shown with the animation effect.

Due to this effect, the position of the tooltip is overlapped with the target element as below.

 

tooltip

To overcome with this issue, you can specify the gap between the tooltip wrapper and the target element by using “Tip” property as below.

 

<div class="frame" id="custom">
  <div class="image">
 <img id="tooltipimg" alt="Python Succinctly" >
   </div>
 <div class="desc">Python Succinctly</div>
 </div>  
</div>
 
<script type="text/javascript">
 
$("#custom").ejTooltip({
 
            content : "Learn to use the Python language to create programs of all kinds to creating practical applications.",
 
             tip :{
         adjust : {xValue : 12, yValue: 6}
       }               
});
 
</script>

 

Tip.adjust property used to specify the gap between tooltip wrapper and target element. So, the tooltip wrapper won’t be overlapped with the target element.

 

tooltip

 

<style class="cssStyles">
 
        .frame{
         box-sizing: border-box;
         border: 1px solid #ccc !important;
         border-radius: 0px;
         padding: 0px;
         text-align: center;
         width : 160px;
        }
        .frame img{
         width : 100%;
        }
        @media (max-width: 440px){
         .frame{
          width : 160px !important;
         }
        }
        .circle {
     
      color: white;
      background: #1dabce;
      border-radius: 10px;
      padding: 2px;
     }
        .image{
         background-color: #ccc;
        }
        img{
         padding-top: 8px;
        }
 
    </style>

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied