简体   繁体   English

使用Java脚本在弹出窗口/工具提示上显示信息?

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

i have a jsp where i have added a logo. 我有一个jsp,我在其中添加了徽标。 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 . 将要显示的文本将从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 title属性中使用它。

<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: 如果在application context设置了您的值,请使用以下命令:

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

or 要么

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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