我有一张图片,当它被点击时,我想显示一些HTML(一个带有文本和按钮的div)。我知道我可以在窗口或面板中使用html配置,但是是否可能在不封装在组件中的情况下显示元素?
这是图片和点击处理程序的代码:
{
xtype:"image",
src:"/blah/helpicon.png",
listeners:{
render: function (c) {
c.getEl().on('click', function(e) {
//show html here, targeted on image icon
}, c);
}
这里是我想展示的HTML,它只是一个漂亮的工具提示而已。由于它是一个工具提示,所以我不想将其封装在窗口中:
<div id="test" class="hopscotch-bubble-container" style="width: 280px; padding: 15px;"><span class="hopscotch-bubble-number">1</span>
<div class="hopscotch-bubble-content"><h3 class="hopscotch-title">Step 1</h3>
<div class="hopscotch-content">Step 1 Instructions here.</div>
</div>
<div class="hopscotch-actions">
<button id="hopscotch-prev" class="hopscotch-nav-button prev hide">Back</button>
<a class="hopscotch-bubble-close" href="#" title="Close">Close</a>
</div>
谢谢。