I am having trying to show content of a <div id="right">
when a mouse is hovered on another div. #right
contains a graph from Angular-charts (http://jtblin.github.io/angular-chart.js/).
Here is my jQuery:
<div>
<div>
<canvas id="doughnut" class="chart chart-doughnut" data="data" labels="labels" legend="true" click="onClick">
</canvas>
</div>
<h3>Some text</h3>
</div>
I tried implementing this to show in #right when hovered over my other div in my jQuery.
$(function(){
$('#some_other_div').on('mouseover', function(){
$('#right').html('<div><canvas id="doughnut" class="chart chart-doughnut" data="data" labels="labels" legend="true" click="onClick"></canvas></div><h3>Some text</h3>');
})
});
When hovering on some_other_div
, Only a blank space and Some text
shows at the bottom. I made sure the graph works elsewhere when implementing it directly in HTML. Only facing this problem through .html.
Is there a way to fix this? Thank you.