【发布时间】:2013-09-24 08:46:12
【问题描述】:
我试图在图像悬停时显示弹出框,弹出框的内容是对模板的 Ajax 调用的响应。在此模板中,我有标签(在 taglib 中使用),其中呈现了我的弹出框模板.在我的回复中,我可以获得我的弹出内容,但它不会显示在图像的悬停上。
编辑: 这是我在模板中使用的标签:
<cv:advice resumeSection="Additional" fieldId="int" resume="${resume}"/>
以及使用标签的taglib:
def advice = { attrs, body ->
Resume resume = attrs.resume
String resumeSection = attrs.resumeSection
String fieldId = attrs.fieldId
AdviceBox adviceBox = AdviceBox.findByResumeSectionAndFieldIdAndResumeType(resumeSection, fieldId, ResumeType.findById(1))
if (adviceBox) {
out << g.render(template: "../templates/popover", model: [adviceBox: adviceBox, resumeSection: resumeSection, fieldId: fieldId])
}
}
弹出框模板代码为:
<a href="#" class="popover-with-html" rel="popover" data-html="true" data-trigger="hover" title="${adviceBox?.title}" data-content="${adviceBox?.content}">
<img onclick="adviceEvent('${resumeSection}', '${fieldId}');" src="${g.resource(dir: 'images/CvSurgeonLegacy', file: 'question_mark.gif')}"/>
</a>
【问题讨论】:
标签: jquery ajax twitter-bootstrap grails popover