cronos cronos - 10 months ago 67
CSS Question

Fade the output after 1 second

I am trying to display the dimensions of the window and finally I was able to do it:

All i want now is to fade the output text after one second after the resize happened; is this possible?

Code here [code][1]


  $(window).on('resize', showSize);
  function showSize() {
    $('#size').show(); // show
    $('#size').html($(window).height() + 'px x ' + $(window).width() + 'px');
        $('#size').fadeOut(); // hide after 1 second
    }, 1000);

updated fiddle: