goodmuyis

How I manage to StackOverflow responsive font-size reading about 5 samples with …

Mon 18 Mar, 2019 10:34 am

How I manage to StackOverflow responsive font-size reading about 5 samples with me input of course

$(window).resize(function() {
    var fontSize = $(window).width()/50 * 1.5;
    var boxW = $('.slider-content').width();
    if( boxW < 767){
        $('.slider-content > h5').css('font-size', fontSize + 5);
        $('.slider-content > h3').css('font-size', fontSize +10);
        $('.slider-content > p').css('font-size', fontSize + 2);
    }
});

Comments

dhtml

Tue 19 Mar, 2019 07:42 am

I remember the days we use to write codes like this with RAW javaScript, no libraries!

goodmuyis

Tue 19 Mar, 2019 10:14 am

We are following your footstep we will get there some days. Also, this size of this code is less than 0.03kb

FincoApps

Sat 30 Mar, 2019 11:36 pm

hmm but things like these can be easily done with pure css naw?

Why go through the hassle?

goodmuyis

Tue 02 Apr, 2019 10:04 am

@FincoApps I dont want to end with 67 lines of css with media-query for each of the elements. This is how Responsive sliders work. Although this one is not perfect compared to what other Premium responsive sliders will do, like having better Calculation and CSS Fallback in case JS is disabled on the browser.

Am still thinking if what I did is called Adaptive or Responsive