score:0
try this way:
var vis=0;
$( document ).scroll(function() {
if(isscrolledintoview(document.getelementbyid('your-element'))){
if(vis==0){
//your code
vis=1;
}
}
});
function isscrolledintoview(el) {
var rect = el.getboundingclientrect();
var elemtop = rect.top;
var elembottom = rect.bottom;
var isvisible = (elemtop >= 0) && (elembottom <= window.innerheight);
return isvisible;
}
Source: stackoverflow.com
Related Query
- Chart.js - How to show loading animation before plotting chart
- Chart disappears just after finishing animation
- How to make bar chart animation where all bars grow at the same speed?
- chart js with angular2 loading dynamic data only after zoomin
- Loading Laravel Chart consoletvs/charts:7.*
- ChartJS replay chart animation when called by show()
- Chart load time and animation slow on mobile device
- ChartJS and Radar Chart animation
- How to loading animation while populating activerecord in Rails 4.0?
- Chartjs Doughnut Chart smooth animation in countdown
- chart js bar chart add animation to change color
- How to show/hide animation when legend clicked chart js
- ChartJs 2 How to remove numbers from the doughnut chart on loading
- what is wrong with my code ? java script chart position
- How to print a chart rendered by code
- Ng2 charts - Animation doesn't work on line chart onInit
- Animation chart js (line), animate chart drawing line by line
- React: How to get loading spinner to show whilst API data loads into my chart.js chart
- Loading data into chart on html page
- VueJS + Chartjs - Chart only renders after code change
- How do I destroy/update Chart Data in this chart.js code example?
- Skipping the initial animation of a line chart
- chart js, loading data dynamically
- Firefox is not responding when loading 800+ data sets in Bar Chart with Charts.Js
- getting additional value fields from data source for dx.chartjs doughnut chart
- I am using chart js to draw a chart. I did everything right but i don't know why the x axis and y axis label is not comming in chart. code below
- loading json file to create chart
- Chart Js , loading data on selection but bar graph displaying old values as well on hovering
- Chart js loading screen
- Loading multiple doughnut chart from chart.JS in a single component of angular 6
More Query from same tag
- How to align multiple pie charts side by side?
- How to add label on chart.js on each point
- How to print a chart rendered by code
- Horizontally align Chart.js y axes
- Update ChartJS line chart from DynamoDB query
- How to take data from an API and create a chart on that using Chart.js and Angular 8?
- how to set title in legend of chart.js?
- Destroy chart.js bar graph to redraw other graph in same <canvas>
- Chart.js how to show line chart without displaying the labels on xaxis and yaxis
- How to add ChartJS code in Html2Pdf to view image
- create different labels for different data chart js
- How can I debug maxTicksLimits in charts.js?
- Adding object data to data structure of chart.js chart does not show any data
- How to display data from top to bottom in stacked bar-chart QuickChart?
- Chart not rendering w/Chart.js on button click
- Increase padding between legend and chart with react-chartjs-2
- chartjs angular update order
- ChartJs line chart time cartesian axis number of ticks and wierd offset
- How to set Json data to chart.js bar
- Chart.js Y axis label, reverse tooltip order, shorten X axis labels
- How to create a charts in Razor Pages pulling data from the database?
- X-axis of Chart.js not taking type : 'time'
- Chart.js - scaleType='date' not working
- Draw borders on line chartjs
- How to detect click on chart js 3.7.1 axis label?
- chart.js v2: Align time scale labels with the center of the bars
- How to make a step line with charts.JS
- Chart.js only last point
- Chart.js: How can I set paddings and draw a background box in a line chart?
- Type check for getElementById only works with optional chaining, not with type check