Contentflow - how to make caption text to dynamic resize?

95 Views Asked by At

I am trying to add text to the images in contentflow but as I scroll through them I need the text to resize so the text does not move.

http://www.jacksasylum.eu/ContentFlow/index.php

1

There are 1 best solutions below

0
On BEST ANSWER

I don't know if there's automatic way of doing this, but as of responsive web design you can hardcore the font size through CSS or using jQuery.

jQuery

$(window).on('resize', function(event) {
    if($(window).width() < 400) {
        $('.CAPTIONCLASS').css("font-size", "20");
    }
    else {
        $('.CAPTIONCLASS').css("font-size", "10");
    }
});

CSS

@media screen and (max-width: 400px) {
    .CAPTIONCLASS {
        font-size: 20px;
    }
}

@media screen and (max-width: 100px) {
    .CAPTIONCLASS {
        font-size: 15px;
    }
}