const throttle = (func, limit) => {
let inThrottle
return function() {
const args = arguments
const context = this
if (!inThrottle) {
func.apply(context, args)
inThrottle = true
setTimeout(() => inThrottle = false, limit)
}
}
}
$('[ID*=fruit]').addEventListener('mouseenter', throttle(() => {
lastnumb= $(this).prop('id').replace(/[^\d;]/g, '');
$('#num_words'+lastnumb).animate({height:'show'},250);
}, 1000));
[1,1,1,1,1, 3,3,3,3,3, 5,5 ,6,6,6, 7,7,7,7,7].filter((v, i, a) => a.indexOf(v) === i);
function download(content, fileName, contentType) {
var a = document.createElement("a");
var file = new Blob([content], {type: contentType});
a.href = URL.createObjectURL(file);
a.download = fileName;
a.click();
}