function scale(block) {
var step = 0.1,
minfs = 9,
scw = block.scrollWidth,
w = block.offsetWidth;
if (scw < w) {
var fontsize = parseInt($(block).css('font-size'), 10) - step;
if (fontsize >= minfs){
$(block).css('font-size',fontsize)
scale(block);
}
}
}
// demo
var text = $('div').html();
$('a').click(function(){
$('div').html($('div').html() + text);
scale($('div')[0]);
});
setTimeout(
() => $(document).on("mouseout", evt => {
if (evt.toElement === null && evt.relatedTarget === null) {
$(evt.currentTarget).off("mouseout");
console.log('intent exit');
}
}), 5000);
swiper.on('slideChange', (e, d) => {
const title = $('.swiper-slide.swiper-slide-active').attr('data-title');
const description = $('.swiper-slide.swiper-slide-active').attr('data-description');
$('.swiper-navigation__title').fadeOut(160, () => {
$('.swiper-navigation__title').html(title).fadeIn(160);
});
$('.swiper-navigation__description').fadeOut(160, () => {
$('.swiper-navigation__description').html(description).fadeIn(160);
});
});