Having trouble getting help?
Contact Support
Contact Support
Custom Tooltip with dynamic HTML
2 Mar 20252 minutes to read
Tooltip loads HTML pages via HTML tags such as iframe, video, and map using the content
property, which supports both string and HTML tags.
To load an iframe
element in Tooltip, set the required iframe in the content
of Tooltip while initializing the Tooltip component. Refer to the following code.
content: '<iframe src="https://ej2.syncfusion.com/showcase/typescript/expensetracker/#/dashboard"></iframe>
<div id="container">
<ejs-tooltip id="target" cssClass="e-tooltip-css" opensOn="Click" width="350" height="250"
content="<iframe src='https://ej2.syncfusion.com/showcase/typescript/expensetracker/#/dashboard' id='tooltipFrame'></iframe>">
<e-content-template>
<div id="tooltipContent">
<div class="content">
<button class="text" id="iframeContent">Embedded Iframe</button>
</div>
</div>
</e-content-template>
</ejs-tooltip>
</div>
<style>
#tooltipContent {
position: relative;
left: 50%;
transform: translateX(-50%);
margin: 65px 10px;
}
.content {
display: inline-block;
width: 49%;
}
#tooltipFrame {
width: 332px;
height: 233px;
}
.content button {
position: relative;
left: 50%;
transform: translateX(-50%);
}
</style>
public ActionResult TooltipView()
{
return View();
}