简体   繁体   中英

Display information on popup window/tool tip using java script?

i have a jsp where i have added a logo. on click/on mouse hover of the logo, i need to display popup window (or tool tip) and display some text in it. the text to be displayed will be retrieved from the application context . How can i achieve it? Please help me.

<table>
    <tr>
        <td align="center" class="bgimg">
            <img src="images/someLogo.gif"/>
        </td>
    </tr>
</table>

Thanks!

First retrieve tool tip text into a variable and use it in img title attribute.

<img src="images/someLogo.gif" title="${tooltipText}"/>  

on mouseover, title text is displayed as tool tip.

If your value is set in application context use this:

<img src="images/someLogo.gif" title="<%=application.getAttribute("YOUR_VAR_NAME")%>"/> 

or

<img src="images/someLogo.gif" alt="<%=application.getAttribute("YOUR_VAR_NAME")%>"/> 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM