function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
NareshKrishnaNareshKrishna 

In visual force, how can we show an image in a tool tip ?

Hi All,

 

I need to show an image as tooltip when user hover the option in the selectCheckboxes.

 

Could you please any one help on this.

 

Thanks

 

Ispita_NavatarIspita_Navatar

Hi NareshKrishna,

If you want to show an image in tooltip place image in a div and initially the divibility of the div should be set to false but on mouse hover /mouseover show the div i.e. set the visibility of the div to true.

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.

NareshKrishnaNareshKrishna

Thanks for your reply.

 

I can able to visible the image on mouse over but not as a tooltip.

Please provide me the sample code for doing this.

And also how can we change the image for each option in <apex:selectOptions> 

 

Below is the code:

<apex:page controller="HomePageController">
<script>
    function checkFn()
    {
        document.getElementById("sample").style.display = '';
    }
    function removeFn()
    {
        document.getElementById("sample").style.display = 'none';
    }   
</script>

  <apex:form >
    <apex:selectCheckboxes value="{!appType}" onmouseover="checkFn();" onmouseout="removeFn();" title="check">
      <apex:selectOptions value="{!items}" />
    </apex:selectCheckboxes>  
    <div id="sample" style="display:none">
        <apex:image url="http://ycombinator.com/images/yc500.gif" height="50px" width="60px"/>
    </div>

  </apex:form>
</apex:page>